Container
Centered, width-constrained page container with shared gutters and four width presets.
Design intent
Pages repeat the same mx-auto/max-w/px trio with slightly different values. Container makes the content width and gutters a shared decision so headers, marketing sections and app pages line up.
npx @slipstream-ui/cli@latest add containerCentered content
The same max-width and gutters on every page keep headers and sections aligned.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| width | 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'lg' | Maximum content width. |
| padding | 'none' | 'sm' | 'md' | 'lg' | 'md' | Horizontal gutters. |
| as | 'div' | 'section' | 'article' | 'header' | 'footer' | 'main' | 'nav' | 'div' | Semantic element to render. |
Anti-patterns
validate_usage is the MCP tool that rejects these mistakes: the same list agents see over MCP and in the canonical markdown.
Don't nest same-width containers
A Container inside a Container doubles the gutters on narrow screens. Use Section's inner container once.
tsx// Avoid<Container><Container>Content</Container></Container>
Accessibility
- Use the as prop for landmarks and add an accessible name when the container is a named region.
Composition
Dependencies
What the registry installs alongside this component. Package imports already include these.
npm packages
- class-variance-authority
- clsx
- tailwind-merge
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+: macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA, the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.