Container
Center content horizontally with predefined max-width
Import
Source
Docs
Package
Usage
Container is the most basic layout element, it centers content horizontally and adds horizontal padding from theme. Component accepts these props:
- size – controls default max width
- sizes - configures container sizes
- fluid – overwrites size prop and sets max width to 100%
Default container
xs container with xs horizontal padding
200px container with 0px horizontal padding
Configure sizes
To configure container sizes use default props on MantineProvider:
Container component props
Name | Type | Description |
---|---|---|
fluid | boolean | If fluid is set to true, size prop is ignored and Container can expand to 100% of width |
size | number | "xs" | "sm" | "md" | "lg" | "xl" | Predefined container max-width or number for max-width in px |
sizes | Record<MantineSize, number> | Container sizes |