Spacing — margin & padding

Size tokens ('xs''xl') resolve to var(--dv-spacing-*). A number is treated as rem. Any other string is passed through as-is.

p="md" — uniform padding

px="xl" py="xs" — horizontal / vertical

mt="md" mb="xs" — top / bottom margin

<Box p="md">uniform padding</Box>
<Box px="xl" py="xs">horizontal / vertical padding</Box>
<Box pt="lg" pb="xs" pl="sm">individual sides</Box>
<Box mt="md" mb="xs">top / bottom margin</Box>
<Box mx="auto">auto horizontal margin (centering)</Box>

Physical vs logical (inline) props

Props like ml and pl set physical left/right sides — they are always left or always right regardless of the document's writing direction. The logical inline props (ms / me and their aliases mis / mie, ps / pe / pis / pie) map to margin-inline-start / margin-inline-end and padding-inline-start / padding-inline-end.

In a left-to-right layout, start = left and end = right. In a right-to-left layout (e.g. Arabic, Hebrew), they automatically flip — no extra CSS needed. Prefer the logical props for any spacing that relates to text flow or reading direction.

ms="xl"
shifted by margin-inline-start
{/* Physical — always left in any language */}
<Box ml="lg">margin-left</Box>
<Box pl="lg">padding-left</Box>

{/* Logical — flips in RTL automatically */}
<Box ms="lg">margin-inline-start</Box>
<Box ps="lg">padding-inline-start</Box>
<Box me="lg">margin-inline-end</Box>
<Box pe="lg">padding-inline-end</Box>
PropCSS propertyNotes
mmargin
mtmargin-top
mbmargin-bottom
mlmargin-leftPhysical
mrmargin-rightPhysical
mxmargin-left + margin-rightPhysical
mymargin-top + margin-bottom
ms / mismargin-inline-startLogical — RTL-safe
me / miemargin-inline-endLogical — RTL-safe
ppadding
ptpadding-top
pbpadding-bottom
plpadding-leftPhysical
prpadding-rightPhysical
pxpadding-left + padding-rightPhysical
pypadding-top + padding-bottom
ps / pispadding-inline-startLogical — RTL-safe
pe / piepadding-inline-endLogical — RTL-safe

UiSpacing'xs' | 'sm' | 'md' | 'lg' | 'xl' (token) | number (rem) | string (raw CSS)

Color — c and bg

Both c (text color) and bg (background) resolve palette names, dot-notation shade/variant selectors, semantic aliases, and raw CSS values. See the Colors page for a full reference with live examples.

c — text color

A plain scale name resolves to -light-color — the accessible text color for tinted backgrounds. Use dot notation to target a specific shade or variant token, or a semantic alias for surface and status colors.

c="violet" → --dv-color-violet-light-color

c="violet.6" → --dv-color-violet-6 (specific shade)

c="violet.filled" → --dv-color-violet-filled

c="violet.outline" → --dv-color-violet-outline

c="dimmed" → --dv-color-dimmed

c="text" → --dv-color-text

c="error" → --dv-color-error

c="#e67e22" → raw CSS (pass-through)

<Text c="violet">scale name → -light-color</Text>
<Text c="violet.6">specific shade</Text>
<Text c="violet.outline">match border color</Text>
<Text c="dimmed">secondary text</Text>
<Text c="error">error / validation</Text>
<Text c="#e67e22">any CSS color</Text>

bg — background

A plain scale name resolves to -light (tinted fill). Use "surface" or "body" for the standard UI surface tokens, or dot notation for a filled or specific-shade background. Raw CSS values (gradients, image URLs, hex, etc.) pass through unchanged.

bg="violet" → --dv-color-violet-light
bg="violet.filled" → --dv-color-violet-filled
bg="violet.3" → --dv-color-violet-3
bg="surface" → --dv-color-surface
bg="body" → --dv-color-body
bg="error" → --dv-color-error
bg="linear-gradient(135deg,#7950f2,#228be6)"
<Box bg="violet">tinted background</Box>
<Box bg="violet.filled" c="violet.filled-color">solid filled</Box>
<Box bg="violet.3" c="violet.9">specific shade</Box>
<Box bg="surface">panel / sidebar background</Box>
<Box bg="body">page background</Box>
<Box bg="error" c="bright">error state</Box>
<Box bg="linear-gradient(135deg,#7950f2,#228be6)">raw gradient</Box>
PropCSS propertyDefault for plain scale name
ccolor"violet"var(--dv-color-violet-light-color)
bgbackground"violet"var(--dv-color-violet-light)
bdborderRaw CSS only (e.g. "1px solid var(--dv-color-border)")

Semantic aliases

Aliasc resolves tobg resolves to
"text"--dv-color-text--dv-color-text
"dimmed"--dv-color-dimmed--dv-color-dimmed
"bright"--dv-color-bright--dv-color-bright
"border"--dv-color-border--dv-color-border
"white"--dv-color-white--dv-color-white
"black"--dv-color-black--dv-color-black
"primary"--dv-color-primary-light-color--dv-color-primary-filled
"error"--dv-color-error--dv-color-error
"success"--dv-color-success--dv-color-success
"warning"--dv-color-warning--dv-color-warning
"info"--dv-color-info--dv-color-info
"body"n/a--dv-color-body
"surface"n/a--dv-color-surface

Dot notation

Append .N (0–9) for a specific palette shade, or a variant suffix for a semantic token. Works identically on both c and bg.

c="violet.6"           // var(--dv-color-violet-6)
c="violet.filled"      // var(--dv-color-violet-filled)
c="violet.filled-color"// var(--dv-color-violet-filled-color)
c="violet.light"       // var(--dv-color-violet-light)
c="violet.light-color" // var(--dv-color-violet-light-color)
c="violet.outline"     // var(--dv-color-violet-outline)

Typography

fz size tokens resolve to var(--dv-font-size-*); a number becomes rem. All other typography props pass their value directly to CSS.

fz="xl" fw=700

fz="sm" c="dimmed"

tt="uppercase" lts="0.08em"

td="underline"

fs="italic"

ta="center"

<Text fz="xl" fw={700}>Large bold</Text>
<Text fz="sm" c="dimmed">Small dimmed</Text>
<Text tt="uppercase" fz="xs" lts="0.08em">uppercase label</Text>
<Text td="underline">underlined</Text>
<Text fs="italic">italic</Text>
<Text ta="center">centered</Text>
PropCSS propertyType
fzfont-size'xs'|'sm'|'md'|'lg'|'xl' | number (rem) | string
fwfont-weightnumber | string
fffont-familystring
lhline-heightstring | number
ltsletter-spacingstring | number (rem)
tatext-align'left' | 'center' | 'right' | 'justify'
fsfont-stylestring
tttext-transform'uppercase' | 'lowercase' | 'capitalize' | 'none'
tdtext-decorationstring

Sizing

A number is treated as pixels. A string is passed through as raw CSS.

maw=300 — constrained width
miw=200 — minimum width
<Box w={200} h={48} />
<Box w="50%" h="4rem" />
<Box maw={400} p="sm">max 400px wide</Box>
<Box mih={100}>at least 100px tall</Box>
PropCSS propertyType
wwidthstring | number (number → px)
hheightstring | number (number → px)
miwmin-widthstring | number (number → px)
mihmin-heightstring | number (number → px)
mawmax-widthstring | number (number → px)
mahmax-heightstring | number (number → px)

Visual

bdrs size tokens resolve to var(--dv-radius-*); a number becomes rem; 'default' uses var(--dv-radius-default).

<Box bdrs="xl" />          {/* var(--dv-radius-xl) */}
<Box bdrs="50%" />         {/* raw CSS → circle */}
<Box opacity={0.5} />
<Box
  bgsz="cover"
  bgp="center"
  bgr="no-repeat"
  bg="url('/hero.jpg')"
/>
PropCSS propertyType
opacityopacitynumber (0–1)
bdrsborder-radius'xs'|'sm'|'md'|'lg'|'xl'|'default' | number (rem) | string
bgszbackground-sizestring
bgpbackground-positionstring
bgrbackground-repeatstring
bgabackground-attachmentstring

Layout & positioning

Dimension values (top, left, etc.) follow the same number→px rule as sizing props.

pos="absolute" top=8 right=8
<Box pos="absolute" top={8} right={8}>pinned</Box>
<Box pos="relative" />
<Box display="flex" flex="1" />
<Box display="grid" />
PropCSS propertyType
pospositionstring
toptopstring | number (number → px)
leftleftstring | number (number → px)
bottombottomstring | number (number → px)
rightrightstring | number (number → px)
insetinsetstring | number (number → px)
displaydisplaystring
flexflexstring | number

Works on every component

Style props are not exclusive to Box — every UI component accepts the full set. Mix them freely with component-specific props.

Badge fz + lts

Text fz + c + td

<Button mt="md" mb="xs" variant="light">
  Button with margin
</Button>

<Badge fz="xs" tt="uppercase" lts="0.05em" px="md">
  Custom badge
</Badge>

<Text fz="lg" fw={700} c="violet" td="underline">
  Styled text
</Text>