Flex Direction
Use flexDirection
prop to control direction of flex items.
Name | Styles |
---|---|
column | |
column-reverse | |
row | |
row-reverse |
#
Documentation
#
#
Usage
#
01
02
03
"use client";
import type { ComponentPropsWithoutRef } from "react";
import { Canvas } from "@/demos/Canvas";
import { Box, Flex } from "@optiaxiom/react";
export function App({
flexDirection = "column",
}: Pick<ComponentPropsWithoutRef<typeof Flex>, "flexDirection">) {
return (
<Canvas asChild>
<Flex flexDirection={flexDirection}>
<Box>01</Box>
<Box>02</Box>
<Box>03</Box>
</Flex>
</Canvas>
);
}
#
Responsive
#
"use client";
import { Canvas } from "@/demos/Canvas";
import { Box, Flex } from "@optiaxiom/react";
export function App() {
return (
<Canvas asChild>
<Flex flexDirection={["column", "row"]} w="auto">
<Box>01</Box>
<Box>02</Box>
<Box>03</Box>
</Flex>
</Canvas>
);
}
Last updated on