A component for creating flex layouts.
Use these props to create flex layouts.
The following props are shared between Box, Container, Flex, Grid, and Section layout components.
This component is based on the div
element and also supports common margin props m
, mx
, my
, ml
, mr
, mt
, mb
. View source
Use the direction
prop to set the flex direction. You can change it across breakpoints using the object syntax.
Use the align
prop to set the alignment of the flex items across the flex direction. Use the justify
prop to control how space is distributed between items along the flex direction.
You can change the values across breakpoints using the object syntax.
We do not plan to implement props for align-self
and justify-self
. UI code tends to be easier to understand and debug when parent components control the layout. Nesting Flex elements is the way to go when you need different alignment within one container.
Use the wrap
prop to control whether the flex items wrap to the next line. You can change the wrapping behaviour across breakpoints using the object syntax.