Flex
Control direction, alignment, spacing and wrapping without adding wrappers around children.
Basic usage
Use gap for spacing and wrap to allow items to move onto another line.
basic.tsx
Direction and alignment
direction controls flow, align controls cross-axis alignment and justify controls main-axis alignment. start / end follow the corresponding flex axis.
Project settings
alignment.tsx
Flex API
Types
FlexGap is number | string. Native div attributes, className, style and DOM refs are supported. Explicit style takes precedence over layout props.
Usage notes
Use Space for simple equal spacing, Flex for main-axis alignment, reversed flow or inline layout, and Grid for columns. Flex preserves the appearance and size of its children.