Container
The Container component centers your content horizontally and manages maximum width based on the current breakpoint.Basic usage
Fluid
By default, the Container is fluid and will grow with the viewport up to a maximum width determined by themaxWidth prop.
Fixed width
Setfixed to true to match the min-width of the current breakpoint instead of being fluid.
Max width
Use themaxWidth prop to set different maximum widths:
Disable gutters
Remove the default left and right padding:Props
ContainerProps
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | - | The content of the component |
classes | Partial<ContainerClasses> | - | Override or extend the styles applied to the component |
component | React.ElementType | 'div' | The component used for the root node |
disableGutters | boolean | false | If true, left and right padding is removed |
fixed | boolean | false | Set the max-width to match the min-width of the current breakpoint |
maxWidth | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false | 'lg' | Determine the max-width of the container |
sx | SxProps<Theme> | - | System prop for defining custom styles |
Breakpoint values
The default breakpoint values formaxWidth:
| Breakpoint | Max-width |
|---|---|
xs | 600px |
sm | 900px |
md | 1200px |
lg | 1536px |
xl | 1920px |