@botiverse/raft-ui

中文文档
0.75.0发布于 2026/11/08MITTypeScriptES Module构建来源已验证近 30 天下载 2.4万

React components and CSS foundations for the Raft Design System.

原始使用文档
文档目录8 节
  1. React
  2. Plain HTML
  3. Tokens
  4. Agent Skills
  5. TanStack Intent
  6. Other installers
  7. Development
  8. Upgrading from raft-ui

raft-ui

Raft Design System foundations for plain HTML, plus React components built with Base UI and Tailwind CSS v4.

React

import { Button } from "@botiverse/raft-ui";
@import "tailwindcss";
@import "@botiverse/raft-ui/styles.css";

Plain HTML

Link dist/foundation.css directly, or copy it beside your HTML. It exposes the same theme variables used by the components, without React, Tailwind, or a CSS reset.

<link rel="stylesheet" href="./foundation.css" />
<style>
  body {
    background: var(--layer-canvas);
    color: var(--foreground);
  }
  article {
    background: var(--layer-canvas);
  }
</style>

Put class="light" or class="dark" on the root to pick a mode; omit it to follow the system mode. Optional fonts.css loads web fonts and defines --heading-font, --sans-font, and --mono-font.

styles.css remains the Tailwind integration entry and imports this foundation automatically.

Tokens

@botiverse/raft-ui/tokens.json holds every token in the Design Tokens Community Group format, with light and dark values, for design tools and code generators. foundation.css is generated from it.

Agent Skills

raft-ui ships two version-matched Agent Skills in the npm package:

  • raft-ui-guide for adopting raft-ui, looking up its API, and where the design system's guidance is.
  • raft-ui-critique for visual, interaction, accessibility, and light/dark review.

TanStack Intent

Allow raft-ui skills in the consuming project's package.json:

{
  "intent": {
    "skills": ["@botiverse/raft-ui"]
  }
}

Install the project guidance, then inspect or load either skill:

pnpm dlx @tanstack/intent@latest install --map
pnpm dlx @tanstack/intent@latest load @botiverse/raft-ui#raft-ui-guide
pnpm dlx @tanstack/intent@latest load @botiverse/raft-ui#raft-ui-critique

Other installers

The package uses the standard skills/*/SKILL.md layout, so consumers can also use tools such as skills-npm or Vercel skills. Installer-specific destination names may add their own package namespace.

Development

  • Install dependencies:
vp install
  • Build the library:
vp pack

Upgrading from raft-ui

The package was published as raft-ui up to 0.6.0. To move a project:

pnpm add @botiverse/raft-ui
node node_modules/@botiverse/raft-ui/codemods/package-name.mjs src
node node_modules/@botiverse/raft-ui/codemods/token-names.mjs src
pnpm remove raft-ui

The first command rewrites imports, CSS @import and @source paths and the dependency, and lists any bare "raft-ui" strings (bundler aliases, path mappings) to change by hand. The second moves to the current token names; the former names keep working until 1.0.

Review two kinds of code by hand after token-names.mjs:

  • Guards that forbid a name. A lint rule, a test or an allowlist that bans a former name (for example a doesNotMatch(/text-foreground-strong/)) has that name rewritten too, so it now bans the current one. Put the former name back there.
  • Patterns built from parts. A regex such as /bg-brutal-[a-z]+/ is not a literal token, so it keeps the former name and stops matching the rewritten source. Widen it to the current name (palette-, brand-, attention-).

If a package you depend on declares raft-ui as a peer dependency, also install "raft-ui": "npm:@botiverse/raft-ui@<version>" so it resolves to the same copy instead of bundling a second one.

版本与发布记录

@botiverse/raft-ui 共发布 110 个版本,首次发布于 2026/10/19;过去 12 个月发布了 110 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.75.0latest2026/11/08今天
0.74.02026/11/08今天
0.73.02026/11/08今天
0.72.02026/11/08今天
0.71.02026/11/061 天前
0.70.02026/11/062 天前

关于 @botiverse/raft-ui 的常见问题

@botiverse/raft-ui 是什么?

React components and CSS foundations for the Raft Design System.

如何安装 @botiverse/raft-ui?

在项目目录运行 npm install @botiverse/raft-ui,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^19)、react-dom(^19)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@botiverse/raft-ui 支持 TypeScript 吗?

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

@botiverse/raft-ui 支持 ESM 还是 CommonJS?

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

@botiverse/raft-ui 可以商用吗?

@botiverse/raft-ui 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@botiverse/raft-ui 的下载量有多少?

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

@botiverse/raft-ui 还在维护吗?

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