@arun-dev/ui

中文文档
5.14.2发布于 2026/10/10MITTypeScriptESM + CJS构建来源已验证近 30 天下载 1832

Brand-agnostic React component library styled entirely via @arun-dev/tokens semantic CSS custom properties

原始使用文档
文档目录4 节
  1. Installation
  2. Setup — tokens are required
  3. Components
  4. Theming

@arun-dev/ui

Brand-agnostic React component library. Components carry no colors of their own — all visual styling resolves through semantic CSS custom properties from @arun-dev/tokens.

Installation

npm install @arun-dev/ui @arun-dev/tokens

Peer dependencies: react >= 19, react-dom >= 19.

Setup — tokens are required

Components read semantic tokens (--color-bg-*, --color-text-*, --color-border-*, …) at render time. Load the tokens and the component styles once, before any component renders:

import '@arun-dev/tokens/base'; // primitives + default brand
import '@arun-dev/ui/components.css'; // all component styles

To use another brand, replace the brand layer: with the published @arun-dev/tokens/brands/arun, or your own stylesheet — either generated by createBrand() from @arun-dev/tokens/createBrand, or hand-written. Any brand CSS must define every variable in the BrandSemanticContract type.

Individual stylesheets are also exported if you prefer à la carte loading: one per component, named after it — @arun-dev/ui/css/dialog, …/css/range-slider, …/css/fieldset — with Button's as …/css/btn, plus …/css/reset, …/css/metric and …/css/utilities.

Components

import { Button, Field, Dialog, RangeSlider } from '@arun-dev/ui';

Each component, its props and live examples are on the documentation site, grouped as they are here:

GroupComponents
FormsCalendar, RangeCalendar, Checkbox, Combobox, DatePicker, DateRangePicker, Field, Input, OtpInput, RadioGroup, RangeSlider, Select, Slider, Switch, Textarea
ActionsButton, Menu, Menubar, Toggle, ToggleGroup, Toolbar
NavigationBreadcrumb, Link, Pagination, Stepper, Tabs, TreeView
OverlaysDialog, Drawer, HoverCard, Popover, Tooltip
FeedbackAlert, Meter, Progress, Skeleton, Spinner, Toast
Data displayAccordion, Avatar, Badge, Card, Chip, Kbd, Table
Layout and typographyGrid, Heading, Paragraph, Separator, Stack, Text

Props types are exported for the components this package defines — ButtonProps, CardProps, BadgeProps and the rest — along with value unions such as ButtonVariant and BadgeTone. Components backed by @arun-dev/headless — Switch, Dialog, Menu, RangeSlider and the other namespaced ones — take its props types; derive them with ComponentProps<typeof Switch.Root>.

Every component also accepts:

  • className — concatenated with the component's own classes, never replacing them.
  • render — an element or component to render instead of the default. Props, className, event handlers and ref are merged onto it. Its own props win, children included: an element with no children of its own takes the component's, one that declares children keeps them.
  • ref — merged with any ref on the render element.
  • any other prop — spread onto the rendered element, so id, aria-*, data-* and event handlers all reach the DOM.
<Chip render={<li />}>React</Chip>
<Card render={<article />} lift>…</Card>

Theming

Light and dark mode come from the token layer — system preference by default, explicit override via data-theme="dark" / data-theme="light" on the root element. Components need no changes.

版本与发布记录

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

版本发布日期距今
5.14.2latest2026/10/1028 天前
5.14.12026/10/1028 天前
5.14.02026/10/1028 天前
5.13.02026/10/1029 天前
5.12.02026/10/1029 天前
5.11.12026/10/1029 天前

关于 @arun-dev/ui 的常见问题

@arun-dev/ui 是什么?

Brand-agnostic React component library styled entirely via @arun-dev/tokens semantic CSS custom properties

如何安装 @arun-dev/ui?

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

@arun-dev/ui 支持 TypeScript 吗?

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

@arun-dev/ui 支持 ESM 还是 CommonJS?

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

@arun-dev/ui 可以商用吗?

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

@arun-dev/ui 的下载量有多少?

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

@arun-dev/ui 还在维护吗?

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