Flex
Flex is a component that sets flex to Box. Also, convenient style shorthand is available.
Import
import { Flex } from "@yamada-ui/react"
Usage
The shorthand provided in Flex is as follows:
direction: This is a shorthandpropsforflexDirection.wrap: This is a shorthandpropsforflexWrap.basis: This is a shorthandpropsforflexBasis.grow: This is a shorthandpropsforflexGrow.shrink: This is a shorthandpropsforflexShrink.align: This is a shorthandpropsforalignItems.justify: This is a shorthandpropsforjustifyContent.
In addition to the shorthand, you can also pass verbose props.
Editable example
<Flex gap="md"> <For each={["primary", "secondary", "warning", "danger"]}> {(bg, index) => ( <Box key={index} p="md" rounded="4" bg={bg} color="white"> Box </Box> )} </For> </Flex>
Using Spacer
Editable example
<Flex w="full" gap="md"> <For each={["primary", "secondary"]}> {(bg, index) => ( <Box key={index} p="md" rounded="4" bg={bg} color="white"> Box </Box> )} </For> <Spacer /> <For each={["warning", "danger"]}> {({ p, rounded, bg, color }, index) => ( <Box key={index} p="md" rounded="4" bg={bg} color="white"> Box </Box> )} </For> </Flex>
Edit this page on GitHub

