loui-ds

中文文档
0.7.0发布于 2026/11/04MITTypeScriptES Module构建来源已验证

Loui DS: a dark, minimal, functional React design system.

原始使用文档
文档目录10 节
  1. Highlights
  2. Install
  3. Quick start
  4. Documentation
  5. For AI tools
  6. Quick start (Windows)
  7. Scripts
  8. Contributing
  9. Project layout
  10. License

Loui DS

A dark, minimal, functional React design system for internal tools, dashboards and apps. Design tokens, accessible components built on React Aria Components, and AI-ready documentation, in one package: loui-ds.

Live Storybook: https://xrazai.github.io/loUI/ · For AI agents: llms.txt, llms-full.txt, manifest.json, tokens.json

Status: pre-1.0, published on npm under the MIT license. All components are experimental; APIs can still change.

Highlights

  • Accessible by default. WCAG 2.2 AA target, keyboard contracts, axe on every story.
  • Tokens first. Every color, space, radius and duration is a --ds-* CSS variable built from DTCG JSON. No raw values in components.
  • React 19, SSR-safe, CSS Modules in named cascade layers, no runtime styling library.
  • i18n built in. English by default, pt-BR included, every string overridable through DSProvider.
  • Made for agents too. A generated component manifest, token manifest and llms.txt keep AI tools exact.

Install

pnpm add loui-ds react react-dom

npm install loui-ds and yarn add loui-ds work too. To upgrade, run pnpm update loui-ds and read the release notes first: before 1.0 a minor version may break. Every release also attaches the package tarball, if you need to install a version by URL.

Requires React 19 and Node 24 or later for tooling.

Quick start

import 'loui-ds/styles.css';
import { Alert, Button, DSProvider } from 'loui-ds';

export function App() {
  return (
    <DSProvider locale="en-US">
      <Alert tone="warning" title="Low stock">
        3 rolls of linen are left. Reorder to avoid delays.
      </Alert>
      <Button variant="primary" onPress={() => console.log('created')}>
        Create order
      </Button>
    </DSProvider>
  );
}

More in Getting started: the stylesheet, DSProvider, fonts, theming and server-side rendering.

Documentation

WhereWhat
Storybook (pnpm storybook)Components, tokens, guides and live examples
IntroductionWhat is in the package and how it is built
PrinciplesThe three rules, clarity and focus, agent principles, visual foundations
Content guidelinesMicrocopy rules
AccessibilityConformance target, keyboard model, how we test
Using with AIManifest, llms.txt, content rules, Storybook MCP
Architecture decisionsWhy things are the way they are (ADR-0001 to ADR-0010)
AGENTS.mdConventions for people and agents working on this repository

For AI tools

Generated, always in sync with the source, committed under docs/ and shipped in dist/:

Quick start (Windows)

Double-click start.cmd in the repo root (or run it from a terminal). It installs pnpm and the dependencies if they are missing, starts Storybook and opens http://localhost:6006 in your browser. On any OS, pnpm install then pnpm start does the same.

Scripts

CommandPurpose
pnpm startStart Storybook on port 6006 and open it in the browser
pnpm storybookStorybook on port 6006 (also serves the MCP endpoint at /mcp)
pnpm buildLibrary build to dist/, then the AI manifests
pnpm build-storybookStatic Storybook
pnpm lint / pnpm typecheckESLint and Stylelint / TypeScript
pnpm testAll Vitest projects (unit, browser, visual, storybook)
pnpm test:unit / pnpm test:browserNode-only tests / component tests in Chromium
pnpm test:a11yStory a11y checks and browser axe tests
pnpm test:visual / pnpm test:visual:updateVisual regression / reviewed baseline update
pnpm tokens:build / pnpm tokens:checkBuild tokens / verify committed output is current
pnpm manifest:build / pnpm manifest:checkRegenerate / verify the manifests, llms.txt and component pages
pnpm checkThe gate: tokens, lint, typecheck, tests and build
pnpm changesetRecord a release note

Contributing

Read AGENTS.md first: it is the single source of truth for conventions. Work comes from TODO.md; finished work is recorded in CHANGELOG.md. Components follow the component workflow. Commits follow Conventional Commits. Everything in this repository is written in English.

After adding or changing a component, regenerate the AI-facing documentation and commit it:

pnpm manifest:build

Project layout

src/
  components/<Name>/   component, CSS Module, messages, stories, tests, <Name>.md
  tokens/              DTCG JSON sources and generated output
  styles/              layered base CSS and fonts
  hooks/ utils/ i18n/  hooks, locale-aware utilities, message catalogs
  docs/                Storybook guide pages
  patterns/            domain patterns (second entry point)
docs/                  guides, ADRs, architecture notes, generated AI docs
schemas/               JSON Schemas for the manifests and content rules
scripts/               token and manifest tooling

License

MIT. The bundled Geist fonts are under the SIL Open Font License (src/styles/fonts/LICENSE.txt).

版本与发布记录

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

版本发布日期距今
0.7.0latest2026/11/041 天前
0.6.02026/11/041 天前
0.5.02026/11/041 天前
0.4.02026/11/041 天前
0.3.02026/11/041 天前
0.2.22026/11/031 天前

关于 loui-ds 的常见问题

loui-ds 是什么?

Loui DS: a dark, minimal, functional React design system.

如何安装 loui-ds?

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

loui-ds 支持 TypeScript 吗?

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

loui-ds 支持 ESM 还是 CommonJS?

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

loui-ds 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

loui-ds 可以商用吗?

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

loui-ds 还在维护吗?

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