Flex

Flex is a div tag that is flexbox by default.

Source
Theme Source
  • Flex - The Flex component.
import { Flex } from "@dreamy-ui/react/rsc";
1
2
3
<Flex color="white" w="full" h="100px">
  <Flex center bg="green.400" w="100px" color='black/87'>
    1
   </Flex>
  <Flex center bg="blue.400" w="1/3">
    2
  </Flex>
  <Flex center bg="purple.400" flex={1}>
    3
  </Flex>
</Flex>

Using boolean props

Flex

<Flex wFull contentBetween itemsCenter>
    <Heading>Flex</Heading>
    <Button variant="primary">
        Button
    </Button>
</Flex>

Using props

Flex

<Flex w="full" justifyContent="space-between" alignItems="center">
    <Heading>Flex</Heading>
    <Button variant="primary">
        Button
    </Button>
</Flex>

Using className css

Flex

<Flex 
    className={css({
      w: "full",
      justifyContent: "space-between",
      alignItems: "center"
    })}
>
    <Heading>Flex</Heading>
    <Button variant="primary">
        Button
    </Button>
</Flex>