Skip to Content
StylingAlign Items

Align Items

Use alignItems prop to control how flex items are aligned on the cross axis.

Name

Styles

center
end
normal
start
stretch

Documentation

01
02
03
"use client"; import type { ComponentPropsWithoutRef } from "react"; import { Box, Group, theme } from "@optiaxiom/react"; export function App({ alignItems = "center", }: Pick<ComponentPropsWithoutRef<typeof Group>, "alignItems">) { return ( <Group alignItems={alignItems} gap="16" h="224" rounded="md" style={stripes} w="full" > <DemoBox flex="1" p="32"> 01 </DemoBox> <DemoBox flex="1" p="64"> 02 </DemoBox> <DemoBox flex="1" p="48"> 03 </DemoBox> </Group> ); } function DemoBox({ children, ...props }: ComponentPropsWithoutRef<typeof Box>) { return ( <Box bg="bg.avatar.purple" display="grid" fontFamily="mono" fontSize="md" fontWeight="600" placeItems="center" rounded="sm" {...props} > {children} </Box> ); } const stripes = { backgroundColor: theme.colors["bg.secondary"], backgroundImage: ` linear-gradient( 135deg, ${theme.colors["bg.avatar.neutral"]} 10%, transparent 0, transparent 50%, ${theme.colors["bg.avatar.neutral"]} 0, ${theme.colors["bg.avatar.neutral"]} 60%, transparent 0, transparent ) `, backgroundSize: "7px 7px", };
"use client"; import type { ComponentPropsWithoutRef } from "react"; import { Box, Group, theme } from "@optiaxiom/react"; export function App() { return ( <Group alignItems={["stretch", "center"]} gap="16" h="224" rounded="md" style={stripes} w="full" > <DemoBox flex="1" p="32"> 01 </DemoBox> <DemoBox flex="1" p="64"> 02 </DemoBox> <DemoBox flex="1" p="48"> 03 </DemoBox> </Group> ); } function DemoBox({ children, ...props }: ComponentPropsWithoutRef<typeof Box>) { return ( <Box bg="bg.avatar.purple" display="grid" fontFamily="mono" fontSize="md" fontWeight="600" placeItems="center" rounded="sm" {...props} > {children} </Box> ); } const stripes = { backgroundColor: theme.colors["bg.secondary"], backgroundImage: ` linear-gradient( 135deg, ${theme.colors["bg.avatar.neutral"]} 10%, transparent 0, transparent 50%, ${theme.colors["bg.avatar.neutral"]} 0, ${theme.colors["bg.avatar.neutral"]} 60%, transparent 0, transparent ) `, backgroundSize: "7px 7px", };
Last updated on