@agentero/design-system

中文文档
0.40.1发布于 2026/11/06Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 4286

A React component library built with Tailwind CSS v4 and Radix UI primitives

原始使用文档
文档目录11 节
  1. Installation
  2. Peer dependencies
  3. Setup
  4. Tailwind CSS configuration
  5. Components
  6. Utilities
  7. cn
  8. AI integration (MCP)
  9. Local development
  10. Unlinking
  11. License

@agentero/design-system

A React component library built with Tailwind CSS v4 and Radix UI primitives. Each component is individually importable, fully typed, and designed to integrate seamlessly into any Tailwind-based project.

Storybook | npm

Installation

yarn add @agentero/design-system

Peer dependencies

This package requires the following peer dependencies:

yarn add react react-dom tailwindcss

Setup

Tailwind CSS configuration

Add the design system as a Tailwind source so that the CSS for component classes is generated:

/* app.css */
@import 'tailwindcss';
@source "@agentero/design-system/theme";

Components

import { ComponentName } from '@agentero/design-system/ComponentName';

Utilities

cn

A class name merging utility combining clsx and tailwind-merge. Useful for conditionally joining Tailwind classes without conflicts.

import { cn } from '@agentero/design-system/lib';

cn('px-4 py-2', isActive && 'bg-blue-500', className);

AI integration (MCP)

This package ships a Model Context Protocol server that gives AI coding assistants access to component documentation, props, and usage examples — no Storybook runtime needed.

Add to your project.mcp.json:

{
    "mcpServers": {
        "design-system": {
            "command": "node",
            "args": ["./node_modules/@agentero/design-system/mcp/server.mjs"]
        }
    }
}

Or run it directly:

npx @agentero/design-system-mcp

The server exposes three tools:

  • list-all-documentation — discover all available components and docs
  • get-documentation — get full docs, props, and usage examples for a component
  • get-documentation-for-story — get details for a specific story variant

Local development

To develop the design system alongside a consumer app without a build process, link the package locally:

# In the design system directory
yarn link

# In the consumer app directory
yarn link @agentero/design-system

The root package.json exports point directly to TypeScript source files, so the consumer's bundler (Vite, Next.js, etc.) picks up changes instantly via HMR — no build step or watcher needed.

If using Next.js, add the package to transpilePackages in next.config.ts:

transpilePackages: ['@agentero/design-system'],

Unlinking

# In the consumer app directory
yarn unlink @agentero/design-system
yarn install --force

License

Apache-2.0

版本与发布记录

@agentero/design-system 共发布 125 个版本,首次发布于 2026/03/26;过去 12 个月发布了 125 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.40.1latest2026/11/061 天前
0.40.02026/11/061 天前
0.39.12026/11/052 天前
0.39.02026/11/043 天前
0.38.92026/11/043 天前
0.38.82026/11/025 天前

关于 @agentero/design-system 的常见问题

@agentero/design-system 是什么?

A React component library built with Tailwind CSS v4 and Radix UI primitives

如何安装 @agentero/design-system?

在项目目录运行 npm install @agentero/design-system,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^19.2.4)、react-dom(^19.2.4)、tailwindcss(^4.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 design-system-mcp,可以用 npx design-system-mcp 直接运行。

@agentero/design-system 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@agentero/design-system 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@agentero/design-system 可以商用吗?

@agentero/design-system 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@agentero/design-system 的下载量有多少?

根据 npm 官方下载统计,@agentero/design-system 在 2026/10/05 – 2026/11/03 这 30 天内被下载 4,286 次,日均约 143 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@agentero/design-system 还在维护吗?

最新版本 0.40.1 发布于 2026/11/06(1 天前);至今共发布 125 个版本,其中过去 12 个月发布了 125 个;首次发布于 2026/03/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。