ComponentsEditorial

Section

Page section frame: a container-query band at three paddings around a centred 80rem column, with background, stack or split header, title group, description, width-capped content, columns and actions.

Open the preview in a new tab

The source comes with full access.

One payment of $149 opens the source right here and lets the CLI install every paid component, with lifetime updates.

Installation

pnpm dlx shadcn add @01orbital/section
npx shadcn add @01orbital/section
yarn shadcn add @01orbital/section
bunx --bun shadcn add @01orbital/section

Part of the 01orbital library. With a license, put ORBITAL_TOKEN in .env.local and the same command installs it (licensed install, pricing).

It lands at components/editorial/section.tsx, as source you own and edit.

The example also uses heading. Install it too:

pnpm dlx shadcn add @01orbital/heading
npx shadcn add @01orbital/heading
yarn shadcn add @01orbital/heading
bunx --bun shadcn add @01orbital/heading

Usage

import { Heading } from "@/components/editorial/heading"
import {
  Section,
  SectionContent,
  SectionDescription,
  SectionHeader,
  SectionTitleGroup,
} from "@/components/editorial/section"

const COPY = {
  text: "Room for every section.",
  description:
    "Shared typography, responsive spacing, and room for your content.",
}

export default function SectionDemo() {
  return (
    <Section>
      <SectionHeader>
        <SectionTitleGroup>
          <Heading size="compact">{COPY.text}</Heading>
        </SectionTitleGroup>
        <SectionDescription>{COPY.description}</SectionDescription>
      </SectionHeader>
      <SectionContent>
        <div className="h-32 rounded-xl bg-muted" aria-hidden="true" />
      </SectionContent>
    </Section>
  )
}

Anatomy

Section is built from 8 parts. In the example they nest like this:

Section
├─ SectionHeader
│  ├─ SectionTitleGroup
│  └─ SectionDescription
└─ SectionContent
  • Section: A full-width page band, as a section. It paints the page background and text color, and centers its children in one column up to 80rem wide, with side gutters and a gap between the header, content and actions.
  • SectionHeader: The top of a section. Holds a SectionTitleGroup, an optional SectionDescription and optional SectionActions, stacked with 24px gaps.
  • SectionTitleGroup: Stacks a section title with what belongs to it, such as an eyebrow above it or a subheading below. gap sets the space between them: sm (the default) 8px, md 12px, lg 24px.
  • SectionDescription: The lead paragraph under a section title, a p by default, in the section's text color. For several paragraphs, pass render={<div />} and put your own p elements inside.
  • SectionContent: The body of a section, under SectionHeader: a centered column, a div by default, that stacks its children.
  • SectionBackground: A layer for art or a fill behind a section's content. Place it as a child of Section: it covers the whole section, sits behind everything else in it, and is hidden from assistive tech and the pointer.
  • SectionColumns: Two columns side by side once the section is 64rem wide, stacked and capped at 42rem below that. equal (the default) splits the width in half. intro gives the first column two fifths and the second three, for a header beside a list.
  • SectionActions: A row of buttons or links, with 16px gaps, that wraps when space runs out. Place it in SectionHeader, or directly in Section after the header for a call to action. align="center" centers the row; inside a centered SectionHeader it centers on its own.

API reference

Section

A full-width page band, as a section. It paints the page background and text color, and centers its children in one column up to 80rem wide, with side gutters and a gap between the header, content and actions.

size sets the top and bottom padding (sm 64px, md 96px by default, lg 128px) and, with it, the gap between parts. className lands on the outer section; children go inside the column. Parts inside it, such as SectionColumns and QuoteGroup, step their layout by the section's width, not the viewport's. Add the dark class to paint it with the dark theme.

Prop

Type

It also accepts the HTML attributes of the element it renders.

SectionHeader

The top of a section. Holds a SectionTitleGroup, an optional SectionDescription and optional SectionActions, stacked with 24px gaps.

size caps its width: sm 32rem, md (the default) 42rem, lg and xl 56rem. align="center" centers it and its text. The split variant fills the full width and, once the section is 42rem wide, sets SectionActions to the right of the title with their bottoms aligned. It takes no size or align.

Prop

Type

It also accepts the HTML attributes of the element it renders.

SectionTitleGroup

Stacks a section title with what belongs to it, such as an eyebrow above it or a subheading below. gap sets the space between them: sm (the default) 8px, md 12px, lg 24px.

direction="row" sets two children side by side once the section is 64rem wide, with their bottoms aligned. gap then applies only while they stack.

Prop

Type

It also accepts the HTML attributes of the element it renders.

SectionDescription

The lead paragraph under a section title, a p by default, in the section's text color. For several paragraphs, pass render={<div />} and put your own p elements inside.

variant="muted" uses the muted text color. size sets the text: sm (the default) 16px, md and lg 18px. In a SectionHeader with size="lg" it stops at 48rem wide.

Prop

Type

It also accepts the props of the Base UI part it wraps, and the HTML attributes of the element it renders.

SectionContent

The body of a section, under SectionHeader: a centered column, a div by default, that stacks its children.

size sets the gap between children: sm 24px, md (the default) 32px, lg 64px. width caps the column. full (the default) fills the section column, so it lines up with the header. sm stays 42rem at every width. md, lg and xl start at 42rem and widen as the section grows, to 48rem, 56rem and 64rem: md suits prose, lg a form, xl a list.

Prop

Type

It also accepts the props of the Base UI part it wraps, and the HTML attributes of the element it renders.

SectionBackground

A layer for art or a fill behind a section's content. Place it as a child of Section: it covers the whole section, sits behind everything else in it, and is hidden from assistive tech and the pointer.

It accepts the HTML attributes of the element it renders.

SectionColumns

Two columns side by side once the section is 64rem wide, stacked and capped at 42rem below that. equal (the default) splits the width in half. intro gives the first column two fifths and the second three, for a header beside a list.

Prop

Type

It also accepts the HTML attributes of the element it renders.

SectionActions

A row of buttons or links, with 16px gaps, that wraps when space runs out. Place it in SectionHeader, or directly in Section after the header for a call to action. align="center" centers the row; inside a centered SectionHeader it centers on its own.

Prop

Type

It also accepts the HTML attributes of the element it renders.

Dependencies

npm: @base-ui/react, class-variance-authority, cn. The CLI installs them for you.

No other registry pieces.

On this page