Container
Constrains and centers content horizontally based on screen breakpoints.
Article
Readable by design
A container caps content at a comfortable measure and keeps it centered, so long text never stretches across the whole viewport. The dashed edge marks the page; the card stays inside the constraint.
Installation
pnpm dlx nachui add containerAnatomy
API Reference
Container
| Prop | Type | Default | Description |
|---|---|---|---|
as | React.ElementType | 'div' | The element type to render the component as |
size | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'fluid' | 'xl' | Container size mapping to max-width breakpoints |
align | 'left' | 'center' | 'right' | 'center' | Horizontal alignment of the container itself |
className | string | - | Custom CSS classes |
Found something to improve?
Notice a bug, typo, or missing detail on this page? Help us make the documentation better by opening a GitHub issue.