Section
The page's rhythm unit, from LAYOUT_PHILOSOPHY.md §7-8: one band that owns its vertical padding, its background tone, its transition dividers and the `<Container>` that measures its children.
Preview
Rendered from the story the storybook (a11y) CI gate runs axe against — the preview can't show something that hasn't been verified.
Install
Two equivalent paths — the URL works in any shadcn-CLI setup; the alias works once you've registered @interlace in your components.json.
npx shadcn@latest add https://ds.interlace.tools/r/section.jsonnpx shadcn@latest add @interlace/sectionHistory
This component is at v1.6.0, first shipped in @interlace/ui 1.0.0. The version is stamped as a banner into the file the install writes, so the copy in your tree says which one you have — compare it with the number above before deciding whether to re-run the install.
@interlace/ui 2.0.04 entries
- Addedminor
Section padding and the h2 and h3 sizes are now fluid. They grow on one smooth curve from a 360px phone to a 1024px laptop, instead of jumping at the
mdandlgbreakpoints. - **New tokens:**--spacing-section-tight,--spacing-section-comfortableand--spacing-section-spacious. They generatepy-section-*, whichSection'sspacingprop now uses. - tight: 48px to 80px - comfortable: 64px to 96px - spacious: 80px to 128px - Each step still clears the layout floors: 40px or more on a phone, and 64px or more by 768px. - A brand retunes the rhythm by re-pointing one variable, such as:root { --spacing-section-comfortable: 5rem; }. - **Headings:** ---text-h2runs from 24px to 30px. It was a fixed 30px. ---text-h3runs from 22px to 24px, so it stays above h4 on a phone. - h4 and smaller, and body text, stay fixed. - Every clamp keeps a rem term, so sizes still scale with zoom and the user's font size. - **Overlap:** theoverlapvariants onSectionneed a singlept-0now, not one per breakpoint.Components - Addedminor
Section's
brandband paints from new--band/--band-foregroundtokens (bg-band,text-band-foreground). They follow the primary pair unless set, so nothing changes by default; a dark scheme can now keep its band deep while its primary is lightened for links and buttons. More-contrast mode puts the band back on its primary pair.Components - Addedminor
Sectiongets abrandtone, the full-bleed brand band (bg-primarywithtext-primary-foreground), and a newoverlapaxis (none,sm,md,lg). A Section withoverlapdrops its own top padding, pulls up by that depth and stacks above the band before it, so a card can straddle the edge of a brand band with no custom class: two Sections, the second withoverlap="md". - Addedminor
Interlace has one named z-index scale.
interlace-baseadds--z-index-*steps, soz-backdrop,z-base,z-raised,z-sticky,z-header,z-indicator,z-overlay,z-modal,z-popover,z-toast,z-tooltipandz-skip-linkare utilities, and an app retunes the order with--z-index-*on:root. Every component now uses a name instead of a number. Topbar, AppHeader and TabBar sit onz-header, above anything inside the page: before, they werez-10like a Section overlap band, ScrollStory steps and a Dialogue speaker, which tied and painted over the sticky header while scrolling. ScrollStory and Dialogue isolate their own layers. Popover and Tooltip set their layer on the positioner, so it reaches the page, and a select or menu inside a dialog opens above it. Numericz-10and friends still work in your app. Decorative backdrops (Sheen, GradientMesh, GridField, SkyBackdrop, CtaSection and FocusGrid media, the TopbarNav pill) move from-z-10toz-backdrop(-1): if you placed your own layer between -10 and -1 behind one of them, it now paints below the backdrop.Components- @interlace/interlace-base
- @interlace/topbar
- @interlace/app-header
- @interlace/tab-bar
- @interlace/scroll-story
- @interlace/dialogue
- @interlace/reading-layout
- @interlace/article-card
- @interlace/timeline
- @interlace/timeline-map
- @interlace/topbar-nav
- @interlace/pull-to-refresh
- @interlace/cta-section
- @interlace/focus-grid
- @interlace/hero-cosmic
- @interlace/sheen
- @interlace/pointer-surface
- @interlace/sky-backdrop
- @interlace/grid-field
- @interlace/gradient-mesh
- @interlace/tooltip
- @interlace/drawer
- @interlace/dropdown-menu
- @interlace/toast
- @interlace/dialog
- @interlace/alert-dialog
- @interlace/combobox
- @interlace/sheet
- @interlace/popover
- @interlace/context-menu
- @interlace/select
- @interlace/reading-strand
- @interlace/card
- @interlace/skip-link
- @interlace/order-game
Import
2 named exports — pull the parts you need.
import { Section, sectionVariants } from '@/components/ui/section';Anatomy
Extracted from the primitive's JSDoc header. The source is the only documentation that can't drift.
Section (section by default — data-spacing / -tone / -divider / -overlap)
└─ Container (always present, size from `container`)
└─ children
The wrapper element is chosen by `as` (`section | header | footer | aside |
div`), a plain string swap rather than Base UI's `render` prop. `children`
always go through a Container: there is no full-bleed escape except
`container="full"`.Variants
Closed prop unions enforced by class-variance-authority. See Storybook's Variants story for the rendered matrix.
- spacing
- tight
- comfortabledefault
- spacious
- none
- tone
- defaultdefault
- muted
- inset
- brand
- divider
- nonedefault
- top
- bottom
- both
- overlap
- nonedefault
- sm
- md
- lg
API reference
Parsed from the type declarations in the source — the same file the install writes into your tree, so this table can't drift from the component you get.
SectionProps
Also accepts every <section> attribute. Plus the variant props listed above.
| Prop | Type | Description |
|---|---|---|
| container | ContainerProps['size'] | Container size that wraps the section's children. Defaults to `content`. |
| as | 'section' | 'header' | 'footer' | 'aside' | 'div' | Render as a different element (e.g. `header`, `footer`). Default `section`. |
| children | React.ReactNode | — |
Accessibility
Every story for this component is rendered headlessly and checked with axe-core (wcag2aa, wcag22aa, best-practice, ACT) on every PR. That gate has no continue-on-error, so what ships has zero known violations.
What follows is what static analysis can see. Axe cannot press a key and never sees an overlay open, so the operable-without-a-mouse claim lives in Behavior instead, where the keyboard path is replayed step by step.
- Focus + keyboard behaviour
- Native element semantics — no interaction layer to get wrong.
- Focus ring (WCAG 2.2 SC 2.4.13)
- Not focusable — no focus indicator required.
- Reduced motion
- No animation to gate.
- ARIA in the source
- None — semantics come from the element or the Base UI primitive rather than hand-written ARIA.
Examples
8 more states from the same story file.
R-rule compliance
Every primitive in @interlace/ui models to the portable 26-rule floor enforced by the componentApi ESLint preset. The cells below pin exactly where each rule applies in this file.
| Rule | Concept | Where |
|---|---|---|
| R4 | Extends native el | `Omit<React.ComponentProps<'section'>, 'children'>` |
| R6 | data-slot + data-* on root | `data-slot="section"` + spacing / tone / divider |
| R7 | cva + cn + ...rest | `cn(sectionVariants({…}), className)` + `{...props}` |
| R8 | Enums, no booleans | five closed enums; no `isMuted`, no `hasDivider` |
| R12 | Reuse over wrap | width and gutters come from `Container`, not from here |
| R19 | Tokens only | `bg-card/30`, `bg-card/50`, `bg-primary`, `border-border` |
| R25 | Server component | No hooks → no `'use client'` |
Dependencies
- Base UI primitive
- Native / no Base UI dependency
- Lucide icons
- none
- NPM dependencies
class-variance-authority
- Registry dependencies
Source
The full implementation — components/ui/section.tsx once installed.
import * as React from 'react';
// @interlace/section v1.6.0 — Interlace design system.
// Docs, props and live preview: https://ds.interlace.tools/c/section
// What changed since: https://ds.interlace.tools/c/section#history
// Generated banner — keep it, the upgrade diff reads this version.
/**
* @interlace/ui — Section
*
* The page's rhythm unit, from LAYOUT_PHILOSOPHY.md §7-8: one band that owns
* its vertical padding, its background tone, its transition dividers and the
* `<Container>` that measures its children.
*
* A page is N of these, so the page file says what is IN each band and never
* what the band looks like.
*
* ## The five axes
*
* - `spacing` → vertical padding, fluid from phone to laptop
…132 more lines…Registry JSON
The raw registry record — what the shadcn CLI fetches.