DeltaValue
A figure with its period-on-period change. Direction is carried by the arrow glyph, so it survives greyscale.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
A figure with its period-on-period change.
Accessibility
Rendered as a real <table> with header scopes; sortable columns expose aria-sort. Row selection and actions are keyboard reachable.
Install and import
npx shadcn@latest add @prism/delta-value
import { DeltaValue } from '@/components/prism/DeltaValue';
In a no-build prototype, read it from the bundle instead: const { DeltaValue } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
value | React.ReactNode | — | The headline figure. Pre-formatted — this component does not format it. |
delta | number | Yes | Signed change. Sign picks the arrow; magnitude is displayed via formatDelta. |
unit | string | — | Suffix on the change. Default "%". |
invertTone | boolean | — | Set when DOWN is the good outcome — cost, churn, latency, defect rate. |
showValue | boolean | — | Hide the figure and show only the change chip. Default true. |
size | "sm" | "md" | "lg" | — | |
neutral | boolean | — | Force the neutral tone — for a change that is neither good nor bad. |
formatDelta | (delta: number) => string | — | Custom formatter for the change magnitude. Receives the signed number. |
label | string | — | What the figure measures, folded into the screen-reader label. |
className | string | — |