Box

A flex container. It stacks its children in a column (direction "row" puts them in a row). Use it to group children with gap, padding, border, radius or background.

Examples

Loading examples…

Props

PropTypeDescription
align"start" | "center" | "end" | "baseline" | "stretch"
justify"start" | "center" | "end" | "spaceBetween" | "spaceAround" | "spaceEvenly" | "stretch"
wrap"nowrap" | "wrap" | "wrap-reverse"
gapnumber | string4px steps when a number
rowGapnumber | string
columnGapnumber | string
paddingnumber | string4px steps when a number
backgroundstringOne of surface|surface-secondary|surface-tertiary|surface-elevated|surface-elevated-secondary|surface-inverted|surface-soft|info|warning|caution|success|danger|discovery|info-solid|warning-solid|caution-solid|success-solid|danger-solid|discovery-solid or a CSS color. Leave it unset. Only one summary panel in a Card can use "surface-secondary"
borderboolean
borderColor"default" | "subtle" | "strong" | "info" | "warning" | "caution" | "success" | "danger" | "discovery"
radius"2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "full" | number | string | object
widthnumber | string
heightnumber | string
minWidthnumber | string
maxWidthnumber | string
minHeightnumber | string
maxHeightnumber | string
flexnumber
weightnumberflex-grow in a Row or Column
aspectRatiostring
scrollableboolean
clipboolean
shadowboolean
inlineboolean
rolestringARIA role
flushbooleanNo padding
minSizenumber | stringMinimum width and height
maxSizenumber | stringMaximum width and height
disableAutoSpacingbooleanNo default gap between children
direction"col" | "row"Default "col"

Slots

  • children · multiple

Events

  • onVisible · Sent once, the first time the container scrolls into view. Use it to load more content lazily.

Link to Box · All standard components

On this page