@graph8/ui

中文文档
0.2.3发布于 2026/11/01MITTypeScriptESM + CJS

Deprecated: moved to @graph8/sdk/ui. @graph8/ui is now a thin re-export of @graph8/sdk/ui, kept so existing imports keep working.

原始使用文档

@graph8/ui (deprecated: moved to @graph8/sdk/ui)

@graph8/ui is now a thin re-export of @graph8/sdk/ui. Same components, same design tokens, one install. Every existing import keeps working, so nothing breaks when you upgrade, but new code should import from the SDK:

npm install @graph8/sdk
// before
import { Button } from "@graph8/ui";
// after
import { Button } from "@graph8/sdk/ui";

Migration table

BeforeAfter
import { Button } from "@graph8/ui"import { Button } from "@graph8/sdk/ui"
import * as Sortable from "@graph8/ui/primitives/sortable"import * as Sortable from "@graph8/sdk/ui/primitives/sortable"
@import "@graph8/ui/theme.css"; (Tailwind v4)@import "@graph8/sdk/ui/theme.css";
@import "@graph8/ui/tokens.css";@import "@graph8/sdk/ui/tokens.css";
import "@graph8/ui/styles.css" (no Tailwind)import "@graph8/sdk/ui/styles.css"

Setup (Tailwind v4 theme, pre-compiled stylesheet, or tokens only) and the component list are documented with the SDK. The component runtime packages (Radix, dnd-kit, recharts, lucide-react, ...) are optional peers of @graph8/sdk; installing @graph8/ui still pulls them in for you, installing @graph8/sdk alone does not.

What this package still does

  • @graph8/ui, @graph8/ui/primitives/* (ESM and CJS) re-export @graph8/sdk/ui and @graph8/sdk/ui/primitives/*.
  • @graph8/ui/styles.css and tokens.css are self-contained copies of the SDK files (no @import), so they keep working from a plain <link> tag. @graph8/ui/theme.css is a one-line @import of the SDK Tailwind preset, resolved by Tailwind v4.
  • React and React DOM are peers (^18 || ^19).

It receives no new features. It will be removed in a future major version.

版本与发布记录

@graph8/ui 共发布 11 个版本,首次发布于 2026/09/15;过去 12 个月发布了 11 个版本。

版本发布日期距今
0.2.3latest2026/11/012 天前
0.2.22026/10/286 天前
0.2.12026/10/1914 天前
0.2.02026/10/1420 天前
0.1.182026/10/1123 天前
0.1.172026/10/1024 天前

关于 @graph8/ui 的常见问题

@graph8/ui 是什么?

已弃用:移至@graph8/sdk/ui。@graph8/ui现在是@graph8/sdk/ui的瘦重导出,保持现有的导入继续工作。

如何安装 @graph8/ui?

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

@graph8/ui 支持 TypeScript 吗?

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

@graph8/ui 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@graph8/ui 可以商用吗?

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

@graph8/ui 还在维护吗?

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