npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fanyucomponents

v2.11.2

Published

一款以 純邏輯為核心、無樣式綁定 的 React 元件套件

Readme


✨ Fanyu Components 是一款以 純邏輯為核心、無樣式綁定 的 React 元件套件,專為自由度與擴充性設計。它提供了一些常見的 UI 元件及互動邏輯,並允許開發者完全控制樣式,適用於各種專案與 Design System 的建立。

🔧 適用場景

  • 希望自由客製樣式的開發者
  • 需要通用型互動邏輯元件(如:冷卻按鈕、彈窗容器)
  • 建立 Design System 或專案通用元件庫
  • 專注於邏輯與功能的開發者

🌟 功能特色

  • ✅ 無樣式綁定:所有元件都專注於功能邏輯,開發者可以完全掌控 UI 呈現,適用於各種樣式庫(如 Tailwind CSS、Styled Components、Emotion 等)。

  • ✅ 高度可擴展性:支援 as props,讓你能靈活地使用不同的 HTML 元素或自定義元件,無需改動原有的邏輯。

  • ✅ 支援常見交互邏輯:如冷卻時間按鈕、彈窗控制、外部連結安全處理等。

  • ✅ 完整的型別定義:TypeScript 型別支持,讓開發過程更加順暢與安全。

  • ✅ 小巧且高效:不含多餘的樣式或依賴,專注於功能,讓你的專案保持輕量。

📦 安裝方式

npm install fanyucomponents

🛠️ 使用範例

你可以自定義和擴展元件屬性,以便它們更適合你的需求:

import { AsComponentProps } from "fanyucomponents";

type CustomComponentProps<Component extends React.ElementType> =
  AsComponentProps<Component, { customProp: string }>;

// 使用 as props 定義自定義組件
const CustomComponent = <Component extends React.ElementType>({
  as,
  customProp,
  ...props
}: CustomComponentProps<Component>) => {
  const Component = as;
  return <Component {...props}>{customProp}</Component>;
};

🤝 貢獻

我們歡迎來自開發者社群的貢獻!如果您有任何想法或發現問題,請隨時提交 Issue,或是創建 Pull Request