@dax-ui/tokens
v0.8.0
Published
Design tokens for dax-ui (plain data, server-safe)
Maintainers
Readme
@dax-ui/tokens
Design tokens: the raw values the theme is built from. Plain data with no React or MUI code, so it can be imported anywhere, including React Server Components, Node scripts and non-React code.
Inside React components, prefer theme values (sx={{ color: 'primary.main' }}), which
follow light/dark mode. Use tokens where there is no theme.
Installation
pnpm add @dax-ui/tokensUsage
import { tokens } from '@dax-ui/tokens';
tokens.color.brand[500]; // '#3b6ef6'
tokens.radius.md; // 8
tokens.spacingUnit * 2; // 16
tokens.font.family; // '"Inter", "Helvetica Neue", Arial, sans-serif'Tokens
| Token | Values |
| --- | --- |
| color.brand | Scale 50, 100, 300, 500, 600, 700, 900 |
| color.neutral | Scale 0, 50, 100, 200, 400, 600, 800, 900, 950 |
| color.success / warning / error / info | Single status colors |
| color.sidebar | backgroundFrom / backgroundTo (gradient), accent (active tile), onAccent |
| radius | sm 4, md 8, lg 12 (px) |
| spacingUnit | 8 (px); theme.spacing(n) is n * spacingUnit |
| font.family | Inter, with system fallbacks |
| font.weight | regular 400, medium 500, semibold 600, bold 700 |
The Tokens type describes the whole object.
