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
| Prop | Type | Default | Description |
|---|---|---|---|
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 |
fluid | boolean | false | If 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' | number | Vertical padding from theme.spacing or number for padding in px | |
children | React.ReactNode | Container content | |
style | ViewStyle | Additional styles to apply to the container | |
p | string | number | Padding on all sides (inherited from BoxView) | |
pt | string | number | Padding top (inherited from BoxView) | |
pb | string | number | Padding bottom (inherited from BoxView) | |
pl | string | number | Padding left (inherited from BoxView) | |
pr | string | number | Padding right (inherited from BoxView) | |
m | string | number | Margin on all sides (inherited from BoxView) | |
mx | string | number | Margin horizontal (inherited from BoxView) | |
my | string | number | Margin vertical (inherited from BoxView) | |
mt | string | number | Margin top (inherited from BoxView) | |
mb | string | number | Margin bottom (inherited from BoxView) | |
ml | string | number | Margin left (inherited from BoxView) | |
mr | string | number | Margin right (inherited from BoxView) |