Style props
The exhaustive catalogue. Every primitive — Box, Stack, Pressable, Text, the typography
suite, styled() outputs — accepts the props listed here. Concept-level discussion lives on
Style props; this page is the lookup.
CSS property props
Every CSS property motif resolves through is exposed as a prop. Names line up with the
camelCase JS form (backgroundColor, paddingInline, gridTemplateColumns). The full set is
exported from @usemotif/core as STYLE_PROP_NAMES.
styleProps is a map from prop name to its definition (StylePropDefinition). The definition
carries the CSS property it serialises to, the value category (color, length, keyword,
…), and whether the prop is responsive-eligible.
Shorthand props
A small set of single-letter and two-letter aliases. Stable across releases.
| Prop | Maps to |
|---|---|
bg | backgroundColor |
m | margin |
mt / mb / ml / mr | marginTop / marginBottom / marginLeft / marginRight |
mx | marginInline |
ms / me | marginInlineStart / marginInlineEnd |
my | marginBlock |
p | padding |
pt / pb / pl / pr | paddingTop / paddingBottom / paddingLeft / paddingRight |
px | paddingInline |
ps / pe | paddingInlineStart / paddingInlineEnd |
py | paddingBlock |
start / end | insetInlineStart / insetInlineEnd |
w | width |
h | height |
minW / minH | minWidth / minHeight |
maxW / maxH | maxWidth / maxHeight |
px / mx, the ps / pe / ms / me shorthands, and the start / end insets are
logical — they resolve relative to the writing direction, so a layout mirrors correctly
under RTL. The physical pl / pr / ml / mr aliases are kept as an explicit escape hatch.
See Direction for setting the writing direction of a subtree.
Pseudo-state props
Style bags applied when a pseudo-class is true. Four states are exposed.
| Prop | Pseudo |
|---|---|
_hover | :hover (web only; no-op on touch surfaces) |
_focus | :focus |
_active | :active (web) / pressed state (native via Pressable) |
_disabled | :disabled |
On web, the runtime emits one CSS rule per unique pseudo-state bag, hashed into a class. On
native, the bags drive Pressable's state callbacks.
Pseudo-element props
Style bags applied to generated content. Two pseudo-elements are exposed.
| Prop | Pseudo-element |
|---|---|
_before | ::before |
_after | ::after |
Both are web-only — native has no analogue. The bag accepts every CSS property, plus the
required content property when generating a pseudo-element.
Motion props
Animation and transition props plus enter/exit hooks for unmount animations.
| Prop | Purpose |
|---|---|
transition | CSS-transition spec. Accepts { property, duration, easing, delay } or a '$transitions.<name>' reference. |
animation | Named keyframe animation. Accepts { name, duration, easing, … } where name is a Keyframe from keyframes or a '$animations.<name>' reference. |
enterStyle | Initial style on mount. The component renders with this style then transitions to its resting state. |
exitStyle | Final style on unmount. The component transitions to this style before being removed. |
animateOnly | Allow-list of style props to animate. Other style changes apply instantly. |
Motion values resolve through the same token pipeline as colour and spacing. transition: { duration: '$durations.2' } is first-class.
Container query prop
_container declares a container-query block. The keys are container-query syntax ('@container (min-width: 480px)'); the values are style bags.
The containerType (or containerName) prop turns the element into a query container; the
_container prop responds inside it. See Responsive for the full
container-query model and the available syntactic forms.
Helpers exported from @usemotif/core
For tooling and runtime-introspection use cases.
| Symbol | Shape | Purpose |
|---|---|---|
STYLE_PROP_NAMES | readonly string[] | The full list of supported CSS-property prop names, in stable order. |
styleProps | Record<string, StylePropDefinition> | Map from prop name to its definition (target CSS property, category, responsive eligibility). |
isStyleProp(name) | (string) => boolean | Membership check against the catalogue. |
PSEUDO_STATE_PROPS | ReadonlySet<string> | Set for fast membership checks. |
PSEUDO_ELEMENT_PROPS | ReadonlySet<string> | Same, pseudo-elements. |
MOTION_PROPS | ReadonlySet<string> | Same, motion. |
isPseudoStateProp(name) / isPseudoElementProp(name) / isMotionProp(name) | (string) => boolean | Targeted membership checks. |
Compiler plugins consume these to classify JSX attributes during static extraction. Application code rarely needs them.
Related
- Style props (concept) — the model behind the catalogue.
- Responsive — the breakpoint and container-query system that builds on every prop here.
Breakpoints— the responsive-key catalogue.Direction— the writing direction the logical props resolve against.