Full-width page section with a surface tone, vertical rhythm and an optional centered container.
Design intent
Marketing and content pages alternate background bands and vertical padding. Section owns the band and the inner container so pages stop repeating py-* and background classes, and tone="inverse" scopes the token ladder for a readable dark band.
npx @slipstream-ui/cli@latest add sectionDefault band
Muted band
Inverse band
Muted text stays readable inside the scope.
padding="lg" width="sm" container={false} — narrow flush band
as="article" width="full" — edge-to-edge article band
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| tone | 'default' | 'muted' | 'subtle' | 'brand' | 'inverse' | 'default' | Surface treatment. inverse flips background, foreground, card, border and muted tokens for its subtree. |
| padding | 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'md' | Vertical rhythm. |
| width | 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'lg' | Inner Container width. |
| container | boolean | true | Wrap children in a centered Container. |
| containerClassName | string | — | Extra classes for the inner Container. |
| as | 'section' | 'div' | 'article' | 'header' | 'footer' | 'main' | 'aside' | 'section' | 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 put a Section inside a Section
Nesting bands doubles padding and can reset the tone. Use one Section per band and plain layout elements inside it.
tsx// Avoid<Section><Section>Content</Section></Section>Don't hardcode colors inside a tone
Use semantic tokens so the inverse scope can flip card, border and muted text automatically.
tsx// Avoid<Section tone="inverse"><div className="bg-slate-900 text-white" /></Section>
Accessibility
- tone="inverse" scopes background, foreground, card, border and muted tokens so child components stay readable.
- Add aria-label or aria-labelledby when the section is a named landmark.
Content guidelines
Section rhythm
- One idea per band
- Alternate default and muted tones
- Use inverse once per page for the final CTA
Good examples
- Default features, muted proof, inverse CTA
Bad examples
- Five alternating dark bands in a row
Composition
Compose with Container: Section renders Container when container is true
<Section width="lg"><Hero /></Section>
Compose with Hero: Hero is placed inside Section; Section owns the band
<Section tone="inverse"><Hero title="." /></Section>
Related components: Container, Hero, PageHeader
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.