Skip to content
InsightCharts

Search

Search guides and components

Hero figure

The opening exhibit of a piece: kicker, headline and deck above one large chart, with a source line underneath.

Use when
At the very top of a data story or a one-page report. The headline states the main fact with its number. The chart shows that fact.
Avoid when
Giving the chart its own title (the headline is the title; use the chart's subtitle for the measure). A second hero on the same page: later sections use section or chart with callout.

Preview

Energy transition

Solar supplied 11.1% of EU electricity in 2024

Coal's share fell from 24.6% in 2015 to 9.8% in 2024.

By Ana Ruiz

Solar and coal share of EU electricity generation, 2015 to 2024

Composition

Built from

The pieces hero figure renders or expects in its slots.

Atoms

4

A featured statistic with its label, change and the context that gives it meaning.

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 sourcing footer for a whole piece: sources with optional links, the period covered, method, caveats and credit.

Used in

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

Installation

$ pnpm dlx shadcn@latest add @insightcharts/hero-figure

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 { HeroFigure } from "insightcharts";

Examples

Centered, big number as the exhibit

33% of the world's population had never used the internet in 2023

The ITU estimates that 2.6 billion people were offline.

People who have never used the internet
2.6 billion
33% of the world's population in 2023

Source: ITU Facts and Figures 2023. Note: Figures are approximate, for illustration.

Props

PropTypeDefaultDescription
titlerequiredstringThe main fact, as one plain sentence with its number.
kickerstringSmall label above the title: the series or topic.
deckstringOne plain sentence under the title that adds a second fact.
bylinestringAuthor line, e.g. "By Ana Ruiz".
datestringPublication date. ISO dates are formatted for the locale.
chartrequiredSlotThe hero chart: a spec or a React element, without its own title.
sourcestring | { name, url? } | (string | { name, url? })[]Where the data comes from. Entries with a url are linked.
periodstringThe period the data covers.
notestringCaveats the reader should know.
align"left" | "center""left"Headline alignment.
level1 | 2 | 3 | 4 | 5 | 61Heading level of the title.
childrenReactNodeJSX alternative to chart.
themeThemeInputTheme override, passed on to the headline, chart and source note.
mode"auto" | "system" | "light" | "dark""auto"Colour mode.