Box
Box is a general-purpose container with sx-like shorthand attributes that map directly to CSS properties.
Basic
Flex Layout
Spacing Shorthands
Single-letter shorthands work for padding (p, pt, pr, pb, pl) and margin (m, mt, mr, mb, ml).
API
| Attribute | CSS Property | Description |
|---|---|---|
display | display | display value. |
flex-direction | flex-direction | — |
justify-content | justify-content | — |
align-items | align-items | — |
gap | gap | — |
bgcolor | background-color | Background color. |
color | color | Text color. |
p / padding | padding | Padding shorthand. |
pt / pr / pb / pl | padding-top/right/bottom/left | Per-side padding. |
m / margin | margin | Margin shorthand. |
mt / mr / mb / ml | margin-top/right/bottom/left | Per-side margin. |
width / height | width / height | Size. |
border-radius | border-radius | — |
overflow | overflow | — |
position | position | — |
z-index | z-index | — |