Skip to content

Box

Box is the fundamental layout container component for building flexbox layouts with theme token shortcuts.

Usage

BoxExample.tsx
import { Box, Text } from '@masumdev/rn-ui';
export function BoxExample() {
return (
<Box row center gap="md" bg="surface" style={{ padding: 16, borderRadius: 12 }}>
<Box flex={1}>
<Text variant="h3">Box Container</Text>
<Text color="textMuted">Flex layout primitive styled with theme tokens.</Text>
</Box>
</Box>
);
}

Props API

PropTypeDefaultDescription
childrenReactNodeContainer children.
rowbooleanfalseSets flex direction to row.
centerbooleanfalseCenters items horizontally and vertically.
gap'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'Spacing gap between flex children.
bgThemeColorNameBackground color token from active theme.
flexnumberFlex grow/shrink value.