Skip to Content

Flexbox

A flexible layout component using CSS Flexbox for one-dimensional arrangements. Provides fine-grained control over alignment, distribution, and wrapping. For common cases, prefer the simpler Row and Column components.

There are convenience components Row and Column which render a Flexbox with the direction pre-selected. You should opt to use them by default as they provide more semantic meaning and are easier to read.

Component props

A Flexbox renders a Box as a child, so it also accepts all Box props.

NameTypeValues
displayResponsive<FlexDisplay>"flex" | "inline-flex" | "none"
directionResponsive<FlexDirection>"row" | "column" | "row-reverse" | "column-reverse"
wrapResponsive<FlexWrap>"wrap" | "nowrap" | "wrap-reverse"
justifyContentResponsive<JustifyContent>"center" | "start" | "end" | "space-between" | "space-around" | ...
justifyItemsResponsive<JustifyItems>"center" | "start" | "end" | "stretch" | "baseline" | ...
alignContentResponsive<AlignContent>"center" | "start" | "end" | "space-between" | "stretch" | ...
alignItemsResponsive<AlignItems>"center" | "start" | "end" | "stretch" | "baseline" | ...
gapResponsive<Gap>true | Spacing scale
gapXResponsive<Gap>true | Spacing scale
gapYResponsive<Gap>true | Spacing scale
asstringHTML element to render
renderRenderPropRender prop for polymorphism