React Native MantineLayout

Container

Responsive container with max-width constraints

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

Usage

import { Container, Text  } from 'react-native-mantine';

// With predefined size
<Container size="md">
  <Text>Content with max width</Text>
</Container>

// Fluid container
<Container fluid>
  <Text>Full width content</Text>
</Container>

// With padding
<Container size="sm" px="xl" py="lg">
  <Text>Padded content</Text>
</Container>

Props

PropTypeDefaultDescription
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | number'md'Predefined container max-width (xs: 540, sm: 720, md: 960, lg: 1140, xl: 1320) or number for max-width in px
fluidbooleanfalseIf true, container will take 100% of available width (ignores size prop)
px'xs' | 'sm' | 'md' | 'lg' | 'xl' | number'md'Horizontal padding from theme.spacing or number for padding in px
py'xs' | 'sm' | 'md' | 'lg' | 'xl' | numberVertical padding from theme.spacing or number for padding in px
childrenReact.ReactNodeContainer content
styleViewStyleAdditional styles to apply to the container
pstring | numberPadding on all sides (inherited from BoxView)
ptstring | numberPadding top (inherited from BoxView)
pbstring | numberPadding bottom (inherited from BoxView)
plstring | numberPadding left (inherited from BoxView)
prstring | numberPadding right (inherited from BoxView)
mstring | numberMargin on all sides (inherited from BoxView)
mxstring | numberMargin horizontal (inherited from BoxView)
mystring | numberMargin vertical (inherited from BoxView)
mtstring | numberMargin top (inherited from BoxView)
mbstring | numberMargin bottom (inherited from BoxView)
mlstring | numberMargin left (inherited from BoxView)
mrstring | numberMargin right (inherited from BoxView)

Source on GitHub · npm