API reference

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.

Updated todayEdit on GitHubWeb & native

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.

example.tsx
import { STYLE_PROP_NAMES, isStyleProp, styleProps } from '@usemotif/core';
 
STYLE_PROP_NAMES.length;  // ~250
isStyleProp('backgroundColor');  // true
styleProps['backgroundColor'];   // { property: 'background-color', category: 'color', … }

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.

PropMaps to
bgbackgroundColor
mmargin
mt / mb / ml / mrmarginTop / marginBottom / marginLeft / marginRight
mxmarginInline
ms / memarginInlineStart / marginInlineEnd
mymarginBlock
ppadding
pt / pb / pl / prpaddingTop / paddingBottom / paddingLeft / paddingRight
pxpaddingInline
ps / pepaddingInlineStart / paddingInlineEnd
pypaddingBlock
start / endinsetInlineStart / insetInlineEnd
wwidth
hheight
minW / minHminWidth / minHeight
maxW / maxHmaxWidth / 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.

example.tsx
import { PSEUDO_STATE_PROP_NAMES } from '@usemotif/core';
 
PSEUDO_STATE_PROP_NAMES;
// ['_hover', '_focus', '_active', '_disabled'] as const
PropPseudo
_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.

example.tsx
import { PSEUDO_ELEMENT_PROP_NAMES } from '@usemotif/core';
 
PSEUDO_ELEMENT_PROP_NAMES;
// ['_before', '_after'] as const
PropPseudo-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.

example.tsx
<Box
_before={{ content: '"›"', mr: '$space.2', color: '$colors.text.muted' }}
/>

Motion props

Animation and transition props plus enter/exit hooks for unmount animations.

example.tsx
import { MOTION_PROP_NAMES } from '@usemotif/core';
 
MOTION_PROP_NAMES;
// ['enterStyle', 'exitStyle', 'transition', 'animation', 'animateOnly'] as const
PropPurpose
transitionCSS-transition spec. Accepts { property, duration, easing, delay } or a '$transitions.<name>' reference.
animationNamed keyframe animation. Accepts { name, duration, easing, … } where name is a Keyframe from keyframes or a '$animations.<name>' reference.
enterStyleInitial style on mount. The component renders with this style then transitions to its resting state.
exitStyleFinal style on unmount. The component transitions to this style before being removed.
animateOnlyAllow-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.

example.tsx
<Box
containerType="inline-size"
_container={{
  '@container (min-width: 480px)': { p: '$space.6', fontSize: '$fontSizes.lg' },
}}
/>

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.

example.tsx
import {
isStyleProp,
isMotionProp,
isPseudoStateProp,
isPseudoElementProp,
STYLE_PROP_NAMES,
PSEUDO_STATE_PROPS,
PSEUDO_ELEMENT_PROPS,
MOTION_PROPS,
styleProps,
} from '@usemotif/core';
SymbolShapePurpose
STYLE_PROP_NAMESreadonly string[]The full list of supported CSS-property prop names, in stable order.
stylePropsRecord<string, StylePropDefinition>Map from prop name to its definition (target CSS property, category, responsive eligibility).
isStyleProp(name)(string) => booleanMembership check against the catalogue.
PSEUDO_STATE_PROPSReadonlySet<string>Set for fast membership checks.
PSEUDO_ELEMENT_PROPSReadonlySet<string>Same, pseudo-elements.
MOTION_PROPSReadonlySet<string>Same, motion.
isPseudoStateProp(name) / isPseudoElementProp(name) / isMotionProp(name)(string) => booleanTargeted membership checks.

Compiler plugins consume these to classify JSX attributes during static extraction. Application code rarely needs them.

  • 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.