Overview
Container is a responsive layout component that constrains content width and centers it horizontally. It provides consistent horizontal padding and max-width presets for creating well-proportioned page layouts.Import
Props
Max-width size preset:
xs: 320pxsm: 384pxmd: 448pxlg: 896px (56rem)xl: 1152px (72rem)2xl: 1280px (80rem)full: 100%
Enables responsive horizontal padding (1rem on mobile, 1.5rem on tablet, 2rem on desktop).
Centers the container horizontally using
mx-auto.Usage
Basic container
Size variants
Without padding
Custom styling
Layout Examples
Page layout
Nested containers
Best Practices
- Use
lgorxlfor general content areas - Use
smormdfor forms and focused UI - Use
2xlfor wide layouts like dashboards - Disable
centeredwhen you need edge-to-edge layouts - Combine with other layout components like Grid or Stack for complex layouts