Skip to content
InsightCharts

Search

Search guides and components

Delta

An inline change indicator: direction arrow, signed value and an optional baseline label.

Use when
Next to a figure, in a sentence, a table cell or a tile, to say how much it changed and against what. Set upIsGood: false for measures where a fall is the good news (churn, emissions, wait times).
Avoid when
Standing alone as the main figure (use big number or stat tile, which include a delta). Do not omit the baseline label unless the surrounding text names it.

Preview

Up +12.4%vs last quarter

Composition

Used in

3 molecules and 1 template use delta.

Molecules

3

Two states of one measure side by side, as figures or small charts, with the change between them stated in the middle.

A table whose rows carry inline sparklines, deltas and in-cell bars beside their exact values, from rows and a column config.

A ranking as a list: position, name, value and a thin in-row bar, with an optional change indicator and highlighted rows.

Templates

1

A recurring report. It has a masthead with the report name and period, a headline that states the main change, a KPI grid with changes and sparklines, a ranked list beside one or two trend charts, an optional comparison table, short notes and a source note.

Installation

$ pnpm dlx shadcn@latest add @insightcharts/delta

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

Examples

Down is good (churn)

Down −2.1%monthly churn vs January

Down is bad, pill

Down −1,840net subscribers this month

No change

No change 0%vs 2023

String value, large pill

Up 3 placesin the regional ranking

Props

PropTypeDefaultDescription
valuerequirednumber | stringThe change. Numbers format as signed percentages by default (0.12 is +12%).
labelstringThe baseline, e.g. "vs last quarter".
upIsGoodbooleantrueWhether an increase is good news; decides the colour only.
direction"up" | "down" | "flat"Override the direction inferred from the sign.
formatFormatSpecsigned percentNumber format, e.g. "signed" for absolute changes or "{value} pts".
size"sm" | "md" | "lg"12, 14 or 16px. Inherits the surrounding size when omitted.
variant"text" | "pill""text"pill adds a tinted capsule behind the value.