Components · Layout
Flex
StableAdded v0.0.1
Flexbox layout primitive.
import { Flex } from '@nexub/react';Playground
Props
direction
<Flex gap="md" align="center">…</Flex>Examples
Default
Space between
Wrap
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| direction | 'row' | 'column' | 'row-reverse' | 'column-reverse' | 'row' | Sets the flex-direction CSS property. |
| align | string | — | Sets the align-items CSS property. |
| justify | string | — | Sets the justify-content CSS property. |
| gap | string | number | — | Spacing between children using design tokens. |
| wrap | boolean | false | Allows children to wrap onto multiple lines. |
| asChild | boolean | false |
On iOS & Android
Web only
Flex has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.