Usage
import { Flex, Spacer } from "@chakra-ui/react"<Flex>
<div />
<div />
</Flex>Examples
Direction
Use the direction or flexDirection prop to change the direction of the flex
Align
Use the align or alignItems prop to align the children along the cross axis.
Justify
Use the justify or justifyContent prop to align the children along the main
axis.
Order
Use the order prop to change the order of the children.
Auto Margin
Apply margin to a flex item to push it away from its siblings.
Spacer
Use the Spacer component to create flexible space between flex items. It will
expand to fill all available space, pushing items to opposite ends.
Wrap
Use the wrap or flexWrap prop to wrap the children when they overflow the
parent.
Props
| Prop | Default | Type |
|---|---|---|
align | SystemStyleObject['alignItems'] | undefined | |
justify | SystemStyleObject['justifyContent'] | undefined | |
wrap | SystemStyleObject['flexWrap'] | undefined | |
direction | SystemStyleObject['flexDirection'] | undefined | |
basis | SystemStyleObject['flexBasis'] | undefined | |
grow | SystemStyleObject['flexGrow'] | undefined | |
shrink | SystemStyleObject['flexShrink'] | undefined | |
inline | boolean | undefined | |
as | React.ElementTypeThe underlying element to render. | |
asChild | booleanUse the provided child element as the default rendered element, combining their props and behavior. For more details, read our Composition guide. |