vert-ui
Browse docs
All components

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.json

Preview

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

space="4.5rem"
<Section space="4.5rem">Content</Section>

Reference

Props

PropTypeDefaultDescription
size"sm" | "md" | "lg" | "xl" | "none""md"Vertical rhythm: responsive padding on the top and bottom.
spacestring—Arbitrary vertical padding (any CSS length). Overrides size.
asChildbooleanfalseRender the child element instead of a section.
classNamestring—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.