Skip to content
InsightCharts

Search

Search guides and components

Social card

A graphic that states one fact, at a fixed aspect ratio (1:1, 4:5, 16:9 or 9:16). It has a kicker, a headline, one exhibit, a source and a credit, painted on the theme surface. A button downloads the whole card as a PNG.

Use when
Use it for one finding that will be shared in a feed, a slide or a chat thread with no text around it. State the fact with its number in the headline. Use one simple exhibit, such as one highlighted bar, one line or one number. Put the source and your name on the card, because it will be shared without the page. Use 1:1 or 4:5 for feeds, 16:9 for slides and link previews, 9:16 for stories.
Avoid when
More than one fact or more than one exhibit (use story deck for a sequence, executive brief for a page). Charts that need a legend, small labels or hovering to read, because a shared image is not interactive. An exhibit with its own title, because the card's headline is the title.

Preview

A template is a whole page, so the preview scrolls inside its frame. Expand it to read it in place, or open it full screen.

Full screen

Climate

The world was 1.6°C warmer in 2024 than in 1850 to 1900

Source: Copernicus Climate Change Service, ERA5 (rounded) · Figures are approximate, for illustrationInsightCharts

Composition

Built from

The social card template is assembled from 4 atoms. Any slot also takes any other component.

Atoms

4

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

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

A sourcing footer for a whole piece: sources with optional links, the period covered, method, caveats and credit.

Shows shares of a whole as counted cells in a grid, such as 37 in every 100.

Installation

$ pnpm dlx shadcn@latest add @insightcharts/social-card

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

Examples

16:9, public health, inverse tone

Public health

Reported measles cases in Europe rose from 61,000 in 2023 to 127,000 in 2024

Source: WHO and UNICEF (rounded) · Figures are approximate, for illustrationData desk

9:16, transport, a proportion instead of a chart

Transport

58% of car journeys in England are under five miles

Each square is 1% of car journeys.

Source: National Travel Survey · Rounded, approximate figures for illustration@datadesk

4:5, personal finance, a single number

Money

Starting to save at 35 instead of 25 leaves $296,000 less at 65

Source: Author's calculation · IllustrativeInsightCharts

Props

PropTypeDefaultDescription
titlerequiredstringThe card's one fact, as a plain sentence with the number in it.
kickerstringSmall label above the title.
deckstringOne short line under the title: the measure, or the number in words.
exhibitSlotThe one exhibit. A chart spec is given the height left in the card (any height you set wins); leave out its title.
sourcestringWhere the data comes from, shown as "Source: ...".
notestringCaveat shown after the source, e.g. "Illustrative data".
creditstringWho made it: a name, handle or publication.
aspect"1:1" | "4:5" | "16:9" | "9:16""1:1"Shape of the card.
tone"surface" | "inverse""surface"inverse paints the card in the opposite colour mode.
downloadablebooleantrueShow the download button under the card. The image is the whole card, drawn from the DOM onto a canvas.
exportWidthnumber1080Width of the downloaded PNG in pixels (1920 for 16:9).
filenamestringFile name without extension. Defaults to a slug of the title.
downloadLabelstring"Download PNG"Label of the download button.
maxWidthnumberWidest the card is drawn on screen, in px. Default 540 (520 for 4:5, 720 for 16:9, 400 for 9:16). In narrower containers the whole card is scaled down, like an image, so its composition never changes.
onExport(blob: Blob) => voidCalled with the PNG after a download.
level1 | 2 | 3 | 4 | 5 | 62Heading level of the title.
themeThemeInputTheme override, passed on to the exhibit.
mode"auto" | "system" | "light" | "dark""auto"Colour mode.