Change Readout

Shows a change both as an amount and a percentage, keeping percentage points apart from percent, so changes aren't misread.

StopsPercentage points mistaken for percent

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/change-readout.json

The files land in your project. They're yours to edit.

Usage

change-readout-usage.tsx
import { ChangeReadout } from "@/components/ui/change-readout"

{ label: "Pro plan price", node: <ChangeReadout from={1200} to={1500} currency="INR" goodDirection="down" />

What it catches

  • Percentage points confused with percent
  • Meaningless percentages from a zero base or a sign change
  • Misleading signs when the base is negative
  • "+150%" misread as 1.5×, by adding the multiple

Props

ChangeReadout props
PropTypeDefault
from* (required)

The earlier value.

number—
to* (required)

The later value.

number—
kind

"percent" when the values are themselves percentages (4 means 4%): the difference is then shown in points.

"number" | "percent""number"
goodDirection

Which way is good news, for colour and the "better/worse" wording. "none" keeps it neutral.

"up" | "down" | "none""up"
currency

Shorthand for currency formatting, e.g. "INR". Ignored when `format` is set.

string—
locale

Locale for number formatting.

string"en-IN"
format

Formats one magnitude (always called with a value ≥ 0 for the delta).

(value: number) => string—
pointsLabel

Unit label for percentage points, e.g. "pts".

string"pts"
pointsHint

Explanation of percentage points, shown as the abbreviation's title.

string"Percentage points: the plain difference between two perc…
zeroBaseText

Shown instead of a percentage when the starting value is zero.

string"no % from 0"
crossesZeroText

Shown instead of a percentage when the value changes sign.

string"crossed zero, no %"
noChangeText

Shown when the values are equal.

string"no change"
betterLabel

Word for a change in the good direction.

string"better"
worseLabel

Word for a change in the bad direction.

string"worse"
toLabel

Word read between the two values.

string"to"

* required. Also accepts the native props of <span> (className, aria-*, data-*…), passed through to it.

Accessibility

  • Arrows and separators are aria-hidden; a text label reads "to" between values
  • Good or bad is stated in words, not only colour
  • "pts" is an <abbr> with an explanatory title

Only what the source does. Test with your own screen reader and content before shipping.

Limitations

  • Formats and labels only; it doesn't know whether the underlying numbers are right
  • Good/bad depends on the goodDirection you set

What it stops

Percentage points mistaken for percent

Also known as

percent change · delta · kpi · growth · pts · dashboard · metric card · trend

Field type

Dependencies

Pairs well with