React Native MantineLayout

Stack

Vertical layout with spacing control

Import: import { Stack } from 'react-native-mantine';

Usage

import { Stack, Button , Badge } from 'react-native-mantine';

// Basic stack with spacing
<Stack spacing={16}>
  <Button>First</Button>
  <Button>Second</Button>
  <Button>Third</Button>
</Stack>

// Centered stack with padding
<Stack spacing={12} position="center" p="md">
  <Badge>Badge 1</Badge>
  <Badge>Badge 2</Badge>
</Stack>

Props

PropTypeDefaultDescription
children (required)React.ReactNodeComponents to be stacked vertically
spacingnumber15Vertical spacing (gap) between stacked children in pixels
positionstringHorizontal alignment of children. Use "center" to center-align items
styleViewStyleAdditional styles applied to the stack container
fullWidthbooleanIf true, sets width to 100% of parent container
fullHeightbooleanIf true, sets height to 100% of parent container
pstring | numberPadding on all sides (accepts "xs", "sm", "md", "lg", "xl" or number)
pxstring | numberHorizontal padding (left and right)
pystring | numberVertical padding (top and bottom)
ptstring | numberPadding top
pbstring | numberPadding bottom
plstring | numberPadding left
prstring | numberPadding right
mstring | numberMargin on all sides (accepts "xs", "sm", "md", "lg", "xl" or number)
mxstring | numberHorizontal margin (left and right)
mystring | numberVertical margin (top and bottom)
mtstring | numberMargin top
mbstring | numberMargin bottom
mlstring | numberMargin left
mrstring | numberMargin right

Source on GitHub · npm