Skip to content
GitHub (opens in a new tab)

Section

Grouped page block with an optional heading, description and actions.

stableMoleculecontracts/section.json

Preview

Section

Grouped page block. Unframed: no fill, radius, border, or box padding. Headings are static by default; pass collapsible for a chevron that toggles the body. Not PageHeader. Not Card. Not FieldSet. Not Accordion.

Master

Medium size with a description and one action. Body is kit Table. Variants shows collapsible and other sizes.

Recent activity

Last 30 days

TaskOwner
Invoice Q3Boris
RenewalsMila

Usage

Use Section to group a heading with related content on a page. It has no fill, radius, border, or box padding — Card owns the framed surface; layout-content owns page inset. The heading is a label by default — no chevron. Pass collapsible when the block should fold. Page title stays on PageHeader. Compact tiles with an image or footer stay Card. Form legends stay FieldSet. Exclusive FAQ lists stay Accordion. Actions must be kit Buttons.

Do's

  • Separating metrics, tables, or form groups on a page
  • Under PageHeader to structure dashboard or settings content

Don'ts

  • Whole page title — use PageHeader
  • Compact tiles with image or footer — use Card
  • Form legends and grouped fields — use FieldSet
  • Modal body layout — keep content minimal inside Modal
  • App-wide navigation — use SideNav (product) or DocsNav (docs/catalog)
  • Exclusive FAQ lists — use Accordion
<Section
  title="Recent activity"
  description="Last 30 days"
  size="md"
  actions={<Button appearance="outline" mode="neutral" size="sm">View all</Button>}
>
  <Table columns={columns} rows={rows} />
</Section>

Grouped page block with optional heading, description, and actions. Unframed: no fill, radius, border, shadow, or box padding — Card owns the framed surface; layout-content owns page inset. Pass collapsible for a chevron that toggles the body.

When to use

  • Separating metrics, tables, or form groups on a page
  • Under PageHeader to structure dashboard or settings content

When not to use

  • Whole page title — use PageHeader
  • Compact tiles with image or footer — use Card
  • Form legends and grouped fields — use FieldSet
  • Modal body layout — keep content minimal inside Modal
  • App-wide navigation — use SideNav (product) or DocsNav (docs/catalog)
  • Exclusive FAQ lists — use Accordion

What an agent reads

import { Section } from "agentic-ds-kit";
must
  • title is a heading (h2 by default, headingLevel 3 or 4) with useId
  • aria-labelledby when title is set
  • When collapsible, the control is a button inside the h2 with aria-expanded and aria-controls
  • Body uses hidden when collapsed
  • count sits outside the heading and is a number, never colour alone
defaults
  • headingLevel 2
  • size md
  • divider false
  • sticky false
  • collapsible false
  • defaultOpen true
stops if
  • Do not invent a local Section or SectionHeader
  • Do not use raw hex
  • Do not use Section as a compact marketing tile — that is Card
  • Do not give Section a fill, radius, border, shadow, or box padding — Card owns the framed surface; layout-content owns page inset
  • Do not use Section as the page title — that is PageHeader
  • Do not embed one-off metric flex rows — use Scoreboard
  • Actions must be kit Buttons
  • Do not compose Accordion or Collapsible for page sections — Section owns collapse
  • Do not use more than one title size per level: page 24 (PageHeader), section 18, card 14

From contracts/section.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
eyebrowstringNo—Short sentence-case line above the title, 12/16 at weight 500. Never uppercase.
iconKitIconNo—A 40px tile (control-height-lg, radius-media-md, bg-tray) with a 16px Lucide icon left of the heading, such as a provider mark on a settings page. Decorative: aria-hidden, the title names the section.
titlestringNo—18/24 at heading weight: the middle of three title sizes (page 24, section 18, card 14).
countnumberNo—A neutral kit Count beside the title, like the number of overdue invoices.
headingLevelenumNo2The title's heading element. Use 3 or 4 when the Section sits under another heading so the outline stays in order. Looks the same at every level.
descriptionstringNo——
sizesm | md | lgNomdControls gap under the heading and between stacked sections via space-section tokens. Does not add box padding.
dividerbooleanNofalseA hairline (border.faint) under the header.
stickybooleanNofalseThe header sticks to the top of its scroll container while the body scrolls. It takes --section-sticky-bg, default surface.page; set it to the surface behind the Section (surface.card inside a Card).
actionsslotNo—kit Buttons only. One primary per view.
childrenslotYes——
collapsiblebooleanNofalseDefault false: static heading, no chevron. True: a 16px chevron before the title toggles the body. Requires title.
defaultOpenbooleanNotrue—
openbooleanNo—controlled
onOpenChangefunctionNo—(open: boolean) => void
  • Component
    →

    PageHeader

    Top-of-page title with optional Breadcrumb trail, subtitle, actions, page Tabs, a profile Avatar and a decorative cover.

  • Component
    →

    Card

    Framed tile with optional header, body, and footer actions.

  • Component
    →

    FieldSet

    Semantic group of fields with a legend and optional description.

  • Component
    →

    Modal

    Dismissible overlay for short tasks, forms, or extra detail.