One headline number with an optional caption, unit and change.
A Markdown brief for Claude, Cursor or v0: install, setup, props and a complete example.
For one headline number with its change, like revenue this month.
A trend over time? Data Viz.
The change is announced as increased, decreased or unchanged, and whether that is good, not just shown as an arrow and a color.
import { Metric } from '@idyeah/diya'Stable since 1.0.0
valueRequiredstringThe headline figure as visible text, already formatted, such as '2,481'.
changeMetricChangeA change against an earlier value, shown under the figure.
labelstringVisible caption above the figure.
size"small" | "medium" | "large"Figure size. Defaults to 'medium'.
Default 'medium'
unitstringVisible unit after the figure, such as 'ms' or '%'.
Also takes every native <div> attribute, such as id, aria-* or data-*.