Flex

Flex

Component for creating flex layouts.

Usage


<Flex gap="4">
  <Box className="w-20 h-20">
    <DecorativeBox />
  </Box>
  <Box className="w-20 h-20">
    <DecorativeBox />
  </Box>
  <Box className="w-20 h-20">
    <DecorativeBox />
  </Box>
  <Box className="w-20 h-20">
    <DecorativeBox />
  </Box>
  <Box className="w-20 h-20">
    <DecorativeBox />
  </Box>
</Flex>

API Reference

This component is based on the div element and supports common margin props.

Use these props to create flex layouts.

PropTypeDefault
asChildbooleanfalse
displaynone | inline-flex | flexflex
directionrow | column | row-reverse | column-reverseNo default value
alignstart | center | end | baseline | stretchNo default value
justifystart | center | end | betweenstart
wrapnowrap | wrap | wrap-reverseNo default value
gapenum

The props are shared between Box, Flex, Grid, Container and Section layout components.