@arcadeai/design-system

中文文档
8.0.1发布于 2026/10/29TypeScriptES Module近 30 天下载 1.2万
原始使用文档
文档目录8 节
  1. Usage
  2. Form groups: Fieldset
  3. shadcn Registry
  4. Development
  5. Contributing
  6. Adding Icons
  7. Adding Toolkits
  8. Adding OAuth Providers

Arcade Design System

Published as @arcadeai/design-system — 100+ accessible React components built on Base UI with Tailwind CSS.

Usage

npm install @arcadeai/design-system

Import styles at your app root:

@import "@arcadeai/design-system/index.css";

Then use components:

import { Button, Card, Input } from "@arcadeai/design-system";

Form groups: Fieldset

Prefer Fieldset over native <fieldset> for groups containing design-system controls, especially permission-gated or managed settings. Import it from @arcadeai/design-system/components/ui/atoms/fieldset.

Fieldset renders a semantic <fieldset> and supplies Base UI's disabled context. Put each Base UI field in FormItem (Field.Root) so radios, checkboxes, switches, and selects inherit disabled. A native <fieldset disabled> does not supply that context. FormItem also works outside React Hook Form.

import { Checkbox } from "@arcadeai/design-system/components/ui/atoms/checkbox";
import { Fieldset } from "@arcadeai/design-system/components/ui/atoms/fieldset";
import { FormItem } from "@arcadeai/design-system/rhf";
import { useId } from "react";

export function NotificationSettings({ canEdit }: { canEdit: boolean }) {
  const id = useId();

  return (
    <Fieldset disabled={!canEdit}>
      <legend>Notifications</legend>
      <FormItem className="flex items-center gap-2">
        <Checkbox defaultChecked id={id} name="emailNotifications" />
        <label htmlFor={id}>Email notifications</label>
      </FormItem>
    </Fieldset>
  );
}

For settings that cannot be edited, use disabled; Fieldset has no group-level readOnly prop. Keep permission checks in submit handlers and on the server.

Native <fieldset> remains appropriate for groups containing only native controls when Base UI context is unnecessary. Custom controls that do not consume Base UI field context still need their own disabled handling.

See the Fieldset implementation and disabled-control tests.

shadcn Registry

The design system is also available as a shadcn registry. Add the registry to your components.json:

{
  "registries": {
    "@arcadeai": "https://ds.arcade.dev/r/{name}.json"
  }
}

Then install components:

npx shadcn@latest add @arcadeai/arcadeai-theme
npx shadcn@latest add @arcadeai/button

For the form-group pattern, install both @arcadeai/fieldset and @arcadeai/form (plus the controls you use), then import from the generated local files:

npx shadcn@latest add @arcadeai/fieldset @arcadeai/form @arcadeai/checkbox

Development

make help      # see all available commands
make install   # install dependencies
make dev       # start Storybook dev server (headless)
make run       # start Storybook (opens browser)
make build     # build the library
make check     # lint + type-check

Contributing

Adding Icons

  1. Place SVG in lib/assets/icons/
  2. Run bun run generate-icons
  3. Import from @arcadeai/design-system/components/ui/atoms/icons

Adding Toolkits

Add entries to lib/metadata/toolkits.ts — see existing entries for the pattern.

Adding OAuth Providers

Add entries to lib/metadata/oauth-providers.ts — see existing entries for the pattern.

版本与发布记录

@arcadeai/design-system 共发布 179 个版本,首次发布于 2025/06/26;过去 12 个月发布了 114 个版本。

版本发布日期距今
8.0.1latest2026/10/2910 天前
8.0.02026/10/2315 天前
7.15.12026/10/2216 天前
7.15.02026/10/2217 天前
7.14.12026/10/2117 天前
7.14.02026/10/2117 天前

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

如何安装 @arcadeai/design-system?

在项目目录运行 npm install @arcadeai/design-system,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=19.2.1)、recharts(>=3.2.0)、react-dom(>=19.2.1)、tailwindcss(>=4.1.13)、lucide-react(>=0.544.0)、react-hook-form(>=7.62.0)、@hookform/resolvers(>=5.2.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@arcadeai/design-system 支持 TypeScript 吗?

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

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

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

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

@arcadeai/design-system 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

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

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

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

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