Tokens
The @usemotif/tokens package ships two ready-to-use themes and the sixteen primitive scales
they are built from. Reach for it when you want a working design system today; build your own
with createTheme when you want full ownership of the values.
Themes
lightTheme
stableconst lightTheme: Theme
darkTheme
stableconst darkTheme: Theme
Both themes share the same semantic surface (surface.base, surface.muted, text.default,
action.primary.bg, …) and the same primitive scales. They differ in which primitive each
semantic path resolves to — that is the whole story of light-vs-dark in this token set.
Primitive scales
Each scale is exported individually so you can compose a custom theme that reuses the motif defaults selectively.
| Scale | Shape | Notes |
|---|---|---|
colors | Record<string, string | Record<string, string>> | Hex codes plus the palette ramps (blue.50 … blue.900). |
space | Record<number | string, number> | Numeric scale (0 … 40 in pixels) plus named extras. |
sizes | Record<string, number | string> | Width / height defaults — xs … 7xl, plus full / screen. |
radii | Record<string, number | string> | Border-radius scale: none, sm, md, lg, xl, full. |
borderWidths | Record<string, number> | Border-width scale: none, hairline, thin, thick. |
fontFamilies | Record<string, string> | Stack strings: sans, serif, mono, display. |
fontSizes | Record<string, number> | Type scale: xs … 7xl in pixels. |
fontWeights | Record<string, number> | 100 … 900 plus named aliases (regular, medium, semibold, …). |
lineHeights | Record<string, number | string> | Numeric ratios + named (tight, snug, …). |
letterSpacings | Record<string, number> | Tracking scale: tighter, tight, normal, wide. |
shadows | Record<string, string> | sm … 2xl plus inner / none. |
durations | Record<string | number, string> | Millisecond strings used by transition / animation. |
easings | Record<string, string> | Named easings: standard, decelerate, accelerate, emphasised. |
opacities | Record<string, number> | 0 to 100 in tens, plus semantic (disabled, subtle). |
zIndices | Record<string, number> | Named layers: hide, auto, base, docked, dropdown, sticky, banner, overlay, modal, popover, tooltip, toast. |
animations | Record<string, AnimationToken> | Reusable keyframe + timing pairs. |
Composing your own theme
The presets are the typical case. When the design system demands different values, compose at the scale level rather than reauthoring everything:
createTheme does no transformation — the returned object is the input, narrowed at the type
level so $-references autocomplete against this theme's shape.
Related
createTheme— build a fresh theme from scratch.- Tokens (concept) — the two-layer model these presets are built on.
- Theming — how a theme becomes active at runtime.