Skip to main content

Flexbox Props

Flexbox props enable flexible box layouts with theme-aware values.

Available Props

PropCSS PropertyTheme Key
alignItemsalign-itemsnone
alignContentalign-contentnone
justifyItemsjustify-itemsnone
justifyContentjustify-contentnone
flexWrapflex-wrapnone
flexDirectionflex-directionnone
flexflexnone
flexGrowflex-grownone
flexShrinkflex-shrinknone
flexBasisflex-basisnone
justifySelfjustify-selfnone
alignSelfalign-selfnone
orderordernone

Usage

<Flex
alignItems="center"
justifyContent="space-between"
flexWrap="wrap"
>
<Box flex="1">Flexible item</Box>
<Box flexShrink="0">Non-shrinking item</Box>
</Flex>

Responsive Flexbox

<Flex
flexDirection={['column', 'row']} // column on mobile, row on larger screens
alignItems="center"
gap={[2, 4]} // theme-aware spacing
>
{/* Flex items */}
</Flex>