Container
Center content with padding and max-width
Import
Source
Docs
Package
Usage
Container
centers content and limits its max-width
to the value specified in size
prop.
Note that the size
prop does not make max-width
responsive, for example,
when it set to lg
it will always be lg
regardless of screen size.
Default Container
xs Container
30rem Container without padding
Fluid
Set fluid
prop to make container fluid, it will take 100% of available width,
it is the same as setting size="100%"
.
Fluid container has 100% max-width
Customize sizes
You can customize existing Container
sizes and add new ones with CSS variables
on theme:
Container with custom size
Responsive max-width
To make Container
max-width
responsive, use Styles API to set
classNames
. For example, you can add responsive
size that will make Container
max-width
different depending on screen size:
Container with responsive size