Installation
Import
Usage
Basic Container
A simple container that centers content with responsive max-width:Fluid Container with Max Width
Set a maximum width for the container using themaxWidth prop:
Fixed Width Container
For a fixed-width container that matches breakpoint widths:Disable Gutters
Remove the default horizontal padding:Props
The Container component extends Material-UI’s ContainerProps and accepts all standard props.Determine the max-width of the container. The container width grows with the size of the screen. Set to
false to disable maxWidth.xs: 444pxsm: 600pxmd: 960pxlg: 1280pxxl: 1920px
Set the max-width to match the min-width of the current breakpoint. This is useful if you’d prefer to design for a fixed set of sizes instead of a fully fluid viewport.
If
true, the left and right padding is removed.The component used for the root node. Either a string to use a HTML element or a component.
The content of the container.
CSS class name to apply to the container.
Inline styles to apply to the container.
Responsive Behavior
The Container component is fully responsive and adjusts its width based on the screen size:| Breakpoint | Size | Container Width (lg) |
|---|---|---|
| xs | <600px | 100% (with padding) |
| sm | ≥600px | 600px |
| md | ≥960px | 960px |
| lg | ≥1280px | 1280px |
| xl | ≥1920px | 1920px |
Examples
Nested Containers
While containers can be nested, most layouts don’t require a nested container:Container with Custom Component
Render the container as a different HTML element:Full Width Container
Disable the max-width constraint:Best Practices
Use Container as the top-level layout component for page content
Choose the appropriate maxWidth based on your content density
Use
disableGutters when you need edge-to-edge contentAccessibility
The Container component:- Uses semantic HTML (default
<div>, customizable withcomponentprop) - Maintains proper document structure
- Preserves content flow for screen readers
- Supports custom ARIA attributes through props

