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

yton-ui

v0.2.0

Published

a react ui library

Readme

YTON UI

这是一个基于 ReactTypeScriptTailwind CSSFramer Motion 的个人 UI 组件库,旨在帮助快速搭建现代化、响应式且具有动效的 Web 应用程序界面。本项目主要作为学习和练习使用,如果你发现任何问题或有任何建议,欢迎提 Issues 和 PRs!

预览

可以点击演示地址查看效果

特性

  • React + TypeScript:利用 React 构建组件,并通过 TypeScript 提供类型安全支持。
  • Tailwind CSS:用于快速布局和样式调整,支持高度可定制化的设计。
  • Framer Motion:用于添加动效,让组件更生动。
  • 响应式设计:支持多端适配,适合桌面和移动设备。

快速开始

先决条件

在开始之前,请确保你已经安装了以下工具:

克隆项目

git clone https://github.com/ytton/yton-ui.git
cd yton-ui

安装依赖

使用 Yarn 或 npm 安装项目依赖:

# 使用 Yarn
yarn install

# 使用 npm
npm install

启动项目

项目是自己封装的文档工具,直接启动dev即可

# 使用 npm
npm run dev

启动后,默认会在浏览器中打开,访问 http://localhost:5173/ 可以查看组件的示例和文档。

使用方法

安装

可以通过以下命令将组件库添加到你的项目中:

npm install yton-ui

引入样式文件

在项目的入口文件(通常是 main.tsx)中引入样式文件:

import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import App from './App.tsx';
import './index.css';
import 'yton-ui/dist/index.css';

createRoot(document.getElementById('root')!).render(
  <StrictMode>
    <App />
  </StrictMode>
);

引入组件

在你的项目中,可以使用以下方式引入并使用库中的组件:

import { Button } from 'yton-ui';

const App = () => {
  return (
    <div className="p-4">
      <Button text="点击我" onClick={() => alert('Hello!')} />
    </div>
  );
};

export default App;

开发指南

创建新组件

  1. src/components 目录中创建一个新的文件夹,并命名为组件名称(例如 Button)。
  2. 创建组件文件,例如 Button.tsx,并使用 React 和 TypeScript 定义组件。
  3. Button.tsx 文件中编写你的组件代码并使用 Tailwind CSS 来进行样式设计。
  4. 为组件添加动画效果(可选),可以使用 Framer Motion 提供的 motion.div 等方法。
  5. docs/pages/components 目录中创建对应的 mdx 文件,如 button/index.mdx,用于组件的展示和文档编写。

构建项目

当项目完成后,你可以将其构建为发布包,项目已经配置了prepublishOnly脚本,在发布前会自动构建项目。

生成的打包文件将位于 dist 目录下,确保无误后可以发布到 npm 或其他包管理平台。

未来计划

  • 增加更多常用 UI 组件
  • 支持更多动画效果
  • 提供更全面的文档和使用示例
  • 完善测试和优化构建流程

贡献

欢迎对本项目的贡献!如果你有新的想法或发现了问题,请通过以下方式参与:

  1. Fork 本项目。
  2. 创建一个新的分支:git checkout -b feature/your-feature
  3. 提交你的更改:git commit -m "增加新功能"
  4. 推送到分支:git push origin feature/your-feature
  5. 提交 Pull Request。

许可证

该项目遵循 MIT 许可证。详情请参见 LICENSE