Section
Full-width page section with vertical rhythm, background variants, and width containment. The outermost layout unit in a page stack.
Anatomy
A Section is always two nested elements: the outer shell (full-bleed background + vertical padding) and an inner container (max-width + auto margins). Never mix concerns between the two.
mx-auto
Vertical Padding Presets
Section vertical rhythm is driven by three responsive token values. Use them consistently so page stacks breathe evenly across breakpoints.
Compact — clamp(2rem, 5vw, 4rem)
Tight sections: banners, dividers, short CTAs.
Standard — clamp(3rem, 8vw, 6rem)
Default for most content sections: features, testimonials, grids.
Generous — clamp(5rem, 12vw, 9rem)
Hero sections, landing page openers — needs room to breathe.
Inner Container Width
The outer shell always stretches edge-to-edge. The inner container constrains readable content. Mix widths within the same section (e.g. full-bleed image + prose caption) by nesting containers.
Full bleed none
Wrapper var(--width-wrapper) / 1280px
Narrow var(--width-narrow) / 860px
Prose var(--width-prose) / 70ch
Background Variants
Backgrounds live on the outer shell only. They create visual rhythm between stacked sections — alternating between these keeps pages from looking flat without adding decorative noise.
White
Default. Start and end with white when unsure.
Surface
Subtle alternation — softer than a hard rule separator.
Dark
High-contrast break. Good for stats, testimonial quotes, CTAs.
Accent
Brand-color sections. Use sparingly — one per page max.
Gradient
Hero openers or feature highlights. Never stack two gradients.
Image / tint
Background image pattern. Always add a semi-transparent overlay for text legibility.
Section Dividers
How adjacent sections meet. Choose based on visual weight — hard rules add structure, angled cuts add energy, no separator lets backgrounds do the work.
No separator — background change alone
Hard rule border-t border-zinc-200
Angled cut — SVG clip-path
Use clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%) on the upper section. Adjust the 88% to control angle steepness.
Wave — inline SVG at section bottom
Place the SVG as the last child of the upper section. Fill color must match the next section's background.
Interactive Playground
Compose vertical padding, inner width, and background in real time.
Section content
Real-world Page Stack
A typical landing page rhythm — six sections, alternating backgrounds, one accent break.
Rules of thumb
- One job per element. The outer shell controls background and vertical space. The inner container controls horizontal width. Never mix them.
- Alternate backgrounds, not borders. Use background changes to separate sections. Add a border only when two adjacent sections share the same background.
- Consistent padding tokens. Use
--spacing-section-yor--spacing-section-gap— never magic numbers. This makes global rhythm changes a one-token edit. - Angled / wave dividers are decoration. Don't let them become a project standard — one or two per page maximum.
- Section ≠ component. A Section wraps components. It should contain no unique logic or specific UI patterns — delegate those to the components inside it.