Container
A layout component that centers content and constrains its maximum width. Perfect for creating consistent page layouts with proper responsive padding.
Import
import { Container } from '@beauginbey/vanilla-components';
Basic Usage
The Container
component centers its content and provides responsive padding.
Size Variants
Containers come in different max-width sizes: 1
(640px), 2
(768px), 3
(1024px), and 4
(1280px).
Alignment
Use the align
prop to control horizontal alignment of the container.
Centered Layout
Containers are perfect for creating centered page layouts.
Nested Containers
Containers can be nested for complex layouts.
Props
Container
accepts all Box
props plus the following:
Prop | Type | Default | Description |
---|---|---|---|
size | '1' | '2' | '3' | '4' | '4' | Maximum width size |
align | 'left' | 'center' | 'right' | 'center' | Horizontal alignment |
Size Reference
1
: 640px max-width2
: 768px max-width3
: 1024px max-width4
: 1280px max-width
The default responsive padding adjusts based on screen size for optimal reading experience.