Spacing

p="md" — uniform padding
px="xl" py="xs" — horizontal / vertical
pt="lg" pb="xs" pl="sm" — individual sides
<Box p="md">uniform padding</Box>
<Box px="xl" py="xs">horizontal / vertical</Box>
<Box pt="lg" pb="xs" pl="sm">individual sides</Box>

Color & background

Violet text
Light background
<Box c="var(--dv-color-violet-filled)" fw={700}>Violet text</Box>
<Box bg="var(--dv-color-violet-light)" c="var(--dv-color-violet-light-color)" p="sm">
  Light background
</Box>

Typography

fz="xl" fw=700
fz="sm" dimmed
tt="uppercase"
ta="center"
<Box fz="xl" fw={700}>Large bold text</Box>
<Box fz="sm" c="var(--dv-color-dimmed)">Small dimmed text</Box>
<Box tt="uppercase" fw={600} fz="xs">uppercase label</Box>
<Box ta="center">Centered text</Box>

Sizing

maw=300 — wraps rather than overflows
<Box w={200} h={48} />
<Box maw={300} p="sm">content constrained to 300px</Box>

Polymorphic element

span
section
<Box component="span" px="sm" py="xs">inline span</Box>
<Box component="section" p="md">section element</Box>

Props

PropTypeDefaultDescription
componentstring'div'Root HTML element
m / mt / mr / mb / ml / mx / my'xs' | 'sm' | 'md' | 'lg' | 'xl'Margin shorthand props
p / pt / pr / pb / pl / px / py'xs' | 'sm' | 'md' | 'lg' | 'xl'Padding shorthand props
cstringText color (CSS value)
bgstringBackground color or image (CSS value)
ta'left' | 'center' | 'right' | 'justify'Text alignment
fz'xs' | 'sm' | 'md' | 'lg' | 'xl' | number | stringFont size
fwnumber | stringFont weight
lhstring | numberLine height
ffstringFont family
fsstringFont style (e.g. 'italic')
tt'uppercase' | 'lowercase' | 'capitalize' | 'none'Text transform
tdstringText decoration
w / hstring | numberWidth / height (number → px)
maw / mahstring | numberMax-width / max-height
miw / mihstring | numberMin-width / min-height
displaystringCSS display value
posstringCSS position value
opacitynumberCSS opacity (0–1)