Skip to content
InsightCharts

Search

Search guides and components

Section

A story section: a numbered step marker or a headline, introductory prose, then one or more exhibits in a responsive one- to three-column grid.

Use when
The building block of a longer piece. Each section states one fact with its number in the title, explains it in a paragraph and shows it in one to three exhibits. Use step when the sections are read in order.
Avoid when
The opening of a piece (use hero figure); a single chart with one callout (use chart with callout directly); more than three exhibits in one section (split it).

Preview

Step 02 of 04: First-quarter churn was 2.0% for customers who joined after March

Monthly churn fell from 4.2% in January to 2.1% in December 2024. The new onboarding launched in March. Customers who joined after March had first-quarter churn of 2.0%. Customers who joined before March had 4.1%.

Monthly churn fell from 4.2% to 2.1% in 2024

Monthly customer churn, 2024

First-quarter churn was 4.1% for customers who joined before March

First-quarter churn by sign-up cohort, 2024

The next section covers the first 90 days after sign-up.

Composition

Built from

The pieces section renders or expects in its slots.

Atoms

6

Compares a value across categories with bars from a zero baseline.

The opening block of a piece or section: kicker, title, one-sentence deck and a byline/date line.

Shows how one or more values change over time or another ordered dimension.

A readable block of narration at a 45-75 character measure, for the text between charts.

A compact, bordered KPI tile: label, value, change against a baseline and an optional trend graphic.

A numbered chapter or step heading ("01 — Electricity sources in 2015") for sequencing the sections of a story.

Used in

No template lists section in its composes. It still fits any slot that takes a component.

Installation

$ pnpm dlx shadcn@latest add @insightcharts/section

The CLI copies the source into your project and needs the @insightcharts registry in components.json; see installation. With the package, import it by name:

import { Section } from "insightcharts";

Examples

Unnumbered, one exhibit, with a rule

Retention

Monthly churn was between 2.1% and 2.4% from August to December 2024

It was 4.2% in January.

Three columns of figures

Product metrics, December 2024

Monthly churn
2.1%
−2.1 ptsvs January
Monthly active users
48.2K
+26.5%vs January
Net revenue retention
112%
Top quartile is 110%

Props

PropTypeDefaultDescription
titlestringThe section's main fact, as one plain sentence with its number.
stepnumber | stringStep number: turns the heading into a numbered chapter marker ("02 — ...").
totalnumberTotal steps, shown as "02 / 05".
kickerstringSmall label above an unnumbered heading.
deckstringOne plain sentence under the heading that adds a second fact.
introstring | string[]Introductory narration. Supports **bold**, *italic* and links.
bodySlot | Slot[]The exhibits: one slot or several, each a spec or a React element.
columns1 | 2 | 31Columns for the body at full width; reduced under 720px and 520px.
outrostring | string[]Closing narration under the body.
rulebooleanfalseHairline above the section.
level1 | 2 | 3 | 4 | 5 | 62Heading level.
idstringAnchor id for deep links.
spacing"compact" | "comfortable""comfortable"Vertical rhythm between heading, intro and body.
childrenReactNodeJSX alternative to body; each child becomes a grid item.
themeThemeInputTheme override, passed on to everything inside.
mode"auto" | "system" | "light" | "dark""auto"Colour mode.