Components
Components
Each component is defined twice: as a spec here (values, states and rules,
so it can be rebuilt in any framework), and as working CSS in
components.css. Open demo.html to
see them all, in light and dark.
CompleteRunning
How components are built
- Tokens only. Every value comes from
tokens.css.components.csshas no dark-mode rules of its own; switching theme only swaps tokens. - State comes from accessible markup. Disabled, busy, invalid, selected,
current and expanded are read from
disabled,aria-busy,aria-invalid,aria-selected/aria-pressed,aria-currentandaria-expanded. A headless library (Base UI, Radix, Ark, Melt) or plain HTML sets those already, so the look follows without extra classes. - Behaviour comes from the platform or a headless library. The CSS doesn't position popovers or trap focus.
- Unprefixed class names (
.btn,.tabs). Add a prefix with one find-and-replace if they'd collide. - One focus style everywhere: a 3px ring in
ringat 50%.
The set
| Component | Classes |
|---|---|
| Button | .btn .btn-outline .btn-secondary .btn-ghost .btn-destructive .btn-link, sizes .btn-xs .btn-sm .btn-lg .btn-icon, .spinner |
| Input and form fields | .field .label .input .textarea .select .checkbox .switch .field-hint .field-error |
| Badge and counter | .badge .badge-success .badge-warning .badge-danger .badge-info .badge-neutral .badge-live .counter |
| Filter chip | .chip-row .chip .chip-dashed |
| Tabs | .tabs .tab .tabs-line .tabs-indicator .tab-panel |
| Card | .card .card-header .card-title .card-description .card-content .card-footer |
| Dialog | .dialog .dialog-header .dialog-title .dialog-description .dialog-footer .dialog-close |
| Menu | .menu .menu-item .menu-item-destructive .menu-label .menu-separator |
| Tooltip | .tooltip .tooltip-arrow |
| Toast | .toast .toast-title .toast-description |
| Banner | .banner |
| Empty state | .empty .empty-icon .empty-title .empty-description .empty-action |
| Loading | .skeleton .skeleton-shimmer .thinking .spinner |
| Stat | .stat-label .stat-value .stat-hint |
| Page header | .page-header .page-title .page-eyebrow .page-description .page-actions |
| Navigation | .nav .nav-item .nav-group-label |
| Table, separator, kbd | .table .separator .kbd |
List and shell pieces (.pane-header, .list-group-header, .list-row,
.app-shell, .page) are documented under Patterns.