Flex

A flexible box layout component that provides a convenient way to create flexbox layouts with various alignment and spacing options.

Most layout controls are boolean toggles. When you omit them, Flex falls back to CSS defaults: row, nowrap, flex-start, and the theme s gap.

XXS
XXS
XXS
XS
XS
XS
S
S
S
M
M
M
L
L
L
XL
XL
XL
XXL
XXL
XXL
XXXL
XXXL
XXXL
CENTER
BOTH AXES
Shorthand
center
Cross axis
y-starty-endy-centery-baseliney-stretch

Props

The idea is that you control the component by using boolean props. This allows you to define layouts quickly.

NameDefaultType
inlinefalseboolean
Makes the flex container inline
wrapfalseboolean
Allows flex items to wrap to multiple lines
wrap-reversefalseboolean
Reverses the wrap direction
rowrowboolean
Sets flex direction to row
columnfalseboolean
Sets flex direction to column
row-reversefalseboolean
Sets flex direction to row-reverse
column-reversefalseboolean
Sets flex direction to column-reverse
gapsxxs xs s m l xl xxl xxxl number
Gap between flex items (theme spacing token or custom unit value)
centerfalseboolean
Centers items on both axes
x-startflex-startboolean
Aligns items to the start of the main axis
x-endfalseboolean
Aligns items to the end of the main axis
x-centerfalseboolean
Centers items along the main axis
x-betweenfalseboolean
Distributes items with space between them
x-aroundfalseboolean
Distributes items with space around them
x-evenlyfalseboolean
Distributes items with equal space around them
y-startflex-startboolean
Aligns items to the start of the cross axis
y-endfalseboolean
Aligns items to the end of the cross axis
y-centerfalseboolean
Centers items along the cross axis
y-baselinefalseboolean
Aligns items along their baselines
y-stretchfalseboolean
Stretches items across the cross axis
expandfalseboolean
Makes the flex container expand to full width

Slots

NameAcceptsDescription
defaultanyThe flex items to be laid out