@teamblind-chorus/ui
v1.2.0
Published
Chorus React components. Ships prebuilt ESM + CJS bundles (`dist/`) and a single `styles.css`; import `@teamblind-chorus/tokens/tokens.css` + `@teamblind-chorus/ui/styles.css` once at the app entry. The contract every component honors lives in schema/comp
Maintainers
Readme
@teamblind-chorus/ui
React component library for the Chorus design system. Ships prebuilt ESM + CJS bundles (dist/) and a single styles.css; import once and use.
The component contract (anatomy, slots, token bindings) lives in schema/components/<family>/<sub>.spec.json in the Chorus monorepo. This package is the React reference implementation of that contract.
License: MIT. See
LICENSE.
Install
npm install @teamblind-chorus/ui @teamblind-chorus/tokensPublic on npmjs.org — no auth, no .npmrc setup required. Peer dependency: react >= 18.
Setup
Two stylesheets and one font, loaded once at your app entry.
// app entry (e.g. Next.js app/layout.tsx, Vite main.tsx)
import '@teamblind-chorus/tokens/tokens.css';
import '@teamblind-chorus/ui/styles.css';Then load Pretendard — the only typeface Chorus speaks. The CDN drop-in works in most setups:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/variable/pretendardvariable-dynamic-subset.min.css" />Dark mode
Tokens flip on the data-theme attribute. Set it on <html> (or any subtree):
<html data-theme="dark">No-script default is light; set the attribute server-side or in an inline <script> before paint to avoid a flash.
Usage
import { Button, Chip, Banner } from '@teamblind-chorus/ui';
export default function Example() {
return (
<>
<Button variant="standard" appearance="filled">Save</Button>
<Chip appearance="assist">Filter</Chip>
<Banner appearance="accent">Heads up.</Banner>
</>
);
}Component-level props (variant, appearance, size, slots) follow the per-component spec in schema/components/. The docs site renders these specs as the authoritative reference.
Use tokens directly in your own CSS
Every system token is emitted as a CSS custom property by @teamblind-chorus/tokens/tokens.css:
.card {
background: var(--sys-color-surface);
color: var(--sys-color-on-surface);
border: 1px solid var(--sys-color-outline-variant);
}Or read the resolved JSON in build tooling:
import lightTokens from '@teamblind-chorus/tokens/resolved.light.json' with { type: 'json' };Agent-friendly docs (Lovable, Cursor, Claude Code, …)
The package self-contains the docs an LLM agent needs. After npm install, they live under node_modules/@teamblind-chorus/ui/agents/:
| File | Purpose |
| :--- | :--- |
| agents/LOVABLE.md | Lovable system-prompt source — paste §1 once per session, §2 per task. |
| agents/AGENTS.md | Hard contract every Chorus-aware agent obeys. |
| agents/catalog.md | Intent → component map. |
| agents/manifest.json | Component inventory. |
| agents/DESIGN.md | Token model, four guiding principles, authorized literal exceptions. |
Also shipped: @teamblind-chorus/ui/placeholder.png — copy once into your app's public/ and reference as src="/placeholder.png".
Native sibling packages (pilot)
The same tokens are generated into Swift and Kotlin sources. UI implementations are early — Button (full spec) and Chip (filter + tag) ported so far:
- iOS (SwiftUI):
@teamblind-chorus/tokens-ios(ChorusTokens) +@teamblind-chorus/ui-ios(ChorusUI). - Android (Compose):
@teamblind-chorus/tokens-android(chorus-tokens) +@teamblind-chorus/ui-android(chorus-ui).
CI runs node packages/tokens-{ios,android}/scripts/check.mjs and fails if schema/tokens/*.json changed without the matching generated Swift/Kotlin sources being regenerated — keeping web, iOS, and Android in lockstep.
Upgrading
npm update @teamblind-chorus/ui @teamblind-chorus/tokensChangelogs are published with each release on the GitHub Releases page of teamblind/chorus and inside each package's CHANGELOG.md.
Versioning
Semver. Breaking changes to component props, slot names, or required CSS variables bump the major version. Token name changes are coordinated with @teamblind-chorus/tokens.
