@aseguragonzalez/ui

中文文档
1.8.8发布于 2026/10/20TypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 2435

Accessible, themeable design system for React SPAs

原始使用文档
文档目录8 节
  1. Install
  2. Setup
  3. Usage
  4. What's included
  5. Theming
  6. Documentation
  7. Storybook
  8. Key principles

Design System

Accessible, themeable React component library. WCAG 2.1 AA out of the box, zero runtime dependencies, CSS Custom Properties theming.

Install

npm install @aseguragonzalez/ui

Setup

Import the stylesheet once at your app entry point:

import '@aseguragonzalez/ui/index.css';

Wrap your app with ToastProvider if you use toast notifications:

import { ToastProvider } from '@aseguragonzalez/ui';

function App() {
  return (
    <ToastProvider>
      <YourApp />
    </ToastProvider>
  );
}

Usage

import { Button, TextField } from '@aseguragonzalez/ui';

function ContactForm() {
  return (
    <form>
      <TextField label="Name" placeholder="Your name" required />
      <TextField label="Email" type="email" />
      <Button variant="primary" type="submit">Send</Button>
    </form>
  );
}

What's included

Primitives — atomic wrappers around HTML5 elements: Button, TextInput, Checkbox, Select, Toggle, Heading, Text, Label, Alert, Badge, Spinner, ProgressBar, Tabs, Tooltip, Modal, Toast, and more.

Composites — primitives combined with Label, Hint, and ErrorMessage for complete, accessible form fields: TextField, TextAreaField, CheckboxField, CheckboxGroup, SelectField, RadioGroup, ToggleField, PasswordField, DateField, and more.

Layout — Navbar, Sidebar, Breadcrumb.

Charts — BarChart, LineChart, DonutChart, ScatterPlot, RadarChart.

Data — DataTable with generic typing, sorting, and an empty state.

Theming

Override semantic CSS Custom Properties to match your brand — no class overrides needed:

:root {
  --ds-color-action-primary:       #7c3aed;
  --ds-color-action-primary-hover: #6d28d9;
  --ds-font-family-base:           'Inter', sans-serif;
}

See docs/theming.md for the full token reference.

Documentation

GuideDescription
Getting startedInstallation, setup, first component
ThemingCustomize with CSS Custom Properties
AccessibilityWCAG 2.1 AA best practices
Responsive designBreakpoints, layout, mobile patterns
UX guidelinesForms, feedback, modals, tooltips
ContributingArchitecture, scripts, adding components

Storybook

Every component has interactive controls, auto-generated docs, and a built-in accessibility audit:

npm run dev   # → http://localhost:6006

Key principles

  • Accessibility first — axe-core runs on every test in error mode; violations fail the suite
  • Zero runtime dependencies — only react and react-dom as peer dependencies
  • CSS Custom Properties only — theming never requires class overrides or build-time configuration
  • Strict TypeScript — all public APIs fully typed; CSS Modules have generated .d.ts files

版本与发布记录

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

版本发布日期距今
1.8.8latest2026/10/2018 天前
1.8.72026/10/1326 天前
1.8.62026/10/1326 天前
1.8.42026/10/1226 天前
1.8.32026/10/1226 天前
1.8.22026/10/1028 天前

关于 @aseguragonzalez/ui 的常见问题

@aseguragonzalez/ui 是什么?

Accessible, themeable design system for React SPAs

如何安装 @aseguragonzalez/ui?

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

@aseguragonzalez/ui 支持 TypeScript 吗?

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

@aseguragonzalez/ui 支持 ESM 还是 CommonJS?

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

@aseguragonzalez/ui 可以商用吗?

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

@aseguragonzalez/ui 的下载量有多少?

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

@aseguragonzalez/ui 还在维护吗?

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