This is the flex container component. It will help to define the number of columns that will be used in the grid. You can also define the gap between the columns. All values are responsive.
Prop | Type | Default | Responsive |
---|---|---|---|
align | startcenterendbaselinestretch | - | Yes |
direction | rowcolumnrow-reversecolumn-reverse | - | Yes |
justify | startcenterendbetween | - | Yes |
children | ReactNode | - | No |
className | string | - | No |
style | CSSProperties | - | No |
The grid component also accepts all the spacing props from the Box component.
Prop | Type | Default | Responsive |
---|---|---|---|
p | 0.511.5234567891011121314string | - | Yes |
px | 0.511.5234567891011121314string | - | Yes |
py | 0.511.5234567891011121314string | - | Yes |
pt | 0.511.5234567891011121314string | - | Yes |
pr | 0.511.5234567891011121314string | - | Yes |
pb | 0.511.5234567891011121314string | - | Yes |
pl | 0.511.5234567891011121314string | - | Yes |
m | 0.511.5234567891011121314string | - | Yes |
mx | 0.511.5234567891011121314string | - | Yes |
my | 0.511.5234567891011121314string | - | Yes |
mt | 0.511.5234567891011121314string | - | Yes |
mr | 0.511.5234567891011121314string | - | Yes |
mb | 0.511.5234567891011121314string | - | Yes |
ml | 0.511.5234567891011121314string | - | Yes |
The Flex component only allows for stacking elements vertically. If you want to create a column layout, please use the Grid component.
<Grid columns={3} gap="4">
<Box>Hello World</Box>
<Box>Hello World</Box>
<Box>Hello World</Box>
</Grid>
A simple example of how to use the Flex component.
<Flex>
<Box>Hello World</Box>
<Box>Hello World</Box>
<Box>Hello World</Box>
</Flex>
The Flex component also supports responsive values, making it easy to create responsive designs.
<Flex gap={{ xs: 'sm', md: 'md' }}>
<Box>Hello World</Box>
<Box>Hello World</Box>
<Box>Hello World</Box>
</Flex>
The Flex component also supports responsive alignment, making it easy to create responsive designs.
<Flex align={{ xs: 'left', md: 'center' }}>
<Box>Hello World</Box>
<Box>Hello World</Box>
<Box>Hello World</Box>
</Flex>