Group
Horizontal layout with spacing control
Import: import { Group } from 'react-native-mantine';
Usage
import { Group, Button , Badge } from 'react-native-mantine';
// Basic group with spacing
<Group spacing={16}>
<Button>First</Button>
<Button>Second</Button>
<Button>Third</Button>
</Group>
// Centered group with alignment
<Group position="center" align="center" spacing={12}>
<Badge>Badge 1</Badge>
<Badge>Badge 2</Badge>
</Group>
// Space-between layout
<Group position="apart">
<Button>Left</Button>
<Button>Right</Button>
</Group>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children (required) | React.ReactNode | Components to be arranged horizontally in a row | |
spacing | number | 5 | Horizontal spacing (gap) between grouped children in pixels |
position | string | Horizontal distribution: "apart" (space-between), "center" (centered), "right" (flex-end), or default (flex-start) | |
align | 'start' | 'center' | 'end' | 'baseline' | 'stretch' | Vertical alignment of children using flexbox alignItems values | |
alignCenter | boolean | true | If true, vertically centers children (shorthand for align="center") |
alignBottom | boolean | false | If true, aligns children to bottom (shorthand for align="end") |
noWrap | boolean | false | If true, prevents children from wrapping to next line (flexWrap: "nowrap") |
style | ViewStyle | Additional styles applied to the group container | |
fullWidth | boolean | If true, sets width to 100% of parent container | |
fullHeight | boolean | If true, sets height to 100% of parent container | |
p | string | number | Padding on all sides (accepts "xs", "sm", "md", "lg", "xl" or number) | |
px | string | number | Horizontal padding (left and right) | |
py | string | number | Vertical padding (top and bottom) | |
pt | string | number | Padding top | |
pb | string | number | Padding bottom | |
pl | string | number | Padding left | |
pr | string | number | Padding right | |
m | string | number | Margin on all sides (accepts "xs", "sm", "md", "lg", "xl" or number) | |
mx | string | number | Horizontal margin (left and right) | |
my | string | number | Vertical margin (top and bottom) | |
mt | string | number | Margin top | |
mb | string | number | Margin bottom | |
ml | string | number | Margin left | |
mr | string | number | Margin right |