To ship a design system on motif, port your tokens into a theme, build primitives on Box and
styled, layer composite components, and export the bundle from a private package. Four passes —
each one a hand-off.
Translate your token spec into a createTheme() call. Keep the palette in the primitive layer
and the intent in the semantic layer; semantic tokens reference primitives by $-path.
Aim for ten or fewer primitives at this layer — a Surface, a Stack, a Heading, a Text,
maybe a Divider. Keep variants narrow. Anything that needs a third axis is probably a composite,
not a primitive.
Compose composites from primitives
Composites are built from primitives, not from Box directly. The wrapping happens once, here, so
consumers never have to nest five <Box>-es to assemble a card.
The Stack primitive carries the spacing; Surface carries the colour; Heading and Text
carry the type ramp. None of those concerns leak into Card.
Package for consumers
Ship the design system as one private package — @your-org/design-system — with three exports:
index.ts
export { lightTheme, darkTheme } from './theme';
export { Surface, Stack, Heading, Text } from './primitives';
export { Card, Button, Modal } from './components';
export type { CardProps, ButtonProps, ModalProps } from './components';
Mark usemotif as a peer dependency, not a regular one. Consumers install usemotif
themselves, which means the design system never ships a duplicate copy. The package.json should
read:
Consumers wire the themes once — <ThemeProvider themes={[lightTheme, darkTheme]} active="light"> —
and import primitives by name from your package. The two layers stay distinct: motif provides the
mechanism, your design system provides the vocabulary.