Section
A page section with consistent vertical spacing. Pair it with Container for full-width bands that keep their content aligned.
Install
Install the component
Add the source straight into your project with the shadcn CLI — no package dependency to track.
npx shadcn@latest add https://vert-ui.dev/r/section.jsonPreview
Live preview
Hero band
Features band
Footer band
Usage
Examples
Alternating full-width bands
First band
Second band
<Section className="bg-muted/40">
<Container>…</Container>
</Section>
<Section className="bg-brand-soft">
<Container>…</Container>
</Section>Custom spacing
<Section space="4.5rem">Content</Section>Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "sm" | "md" | "lg" | "xl" | "none" | "md" | Vertical rhythm: responsive padding on the top and bottom. |
| space | string | — | Arbitrary vertical padding (any CSS length). Overrides size. |
| asChild | boolean | false | Render the child element instead of a section. |
| className | string | — | Merged last, so you can override padding or add a background. |
Accessibility
Accessibility notes
- Renders a <section> so it can be named by a heading — give the section a heading and, when there is more than one, an aria-labelledby pointing at it.
- Vertical spacing only: no horizontal gutters, so pair it with Container to keep content aligned and clear of the viewport edges.
- Use asChild to swap in <article>, <footer> or <aside> when that landmark is more accurate.