A number that is its records: SourcedValue buttons that flash and strike the figure they replace, plus one provider for what figures open (onSelect) and how links render (renderLink).
Click a figure: what it would open shows here.
$ npx shadcn@latest add @highcommand/numCopies the source into your project and pulls in what it needs (3 other items). First time? Add the registry to components.json.
Every number on screen is one of these: a button that opens the source records (the page's `onSelect`, or this one's).
vrequiredSourcedValue—The value to show; its `label` names the button and is its `data-num`.
childrenReactNode—Shown in place of the formatted value.
classNamestring—Extra class on the button (or the plain text).
onSelect(v: SourcedValue) => void—Opens this value's records; defaults to the page's `CommandActionsProvider` handler.
centsboolean—Show cents on money (default: whole dollars, rounded half up).
compactboolean—Compact money from $100,000 up ($1.23M, $450k).
tone'late' | 'on_track' | 'at_risk' | 'blocked' | 'dim'—Colours the figure with a status token (`dim` is a quiet grey).
<CommandActionsProvider />3 propsSets the click and link behaviour for every figure under it (see `CommandActions`).childrenrequiredReactNode—The part of the page the actions apply to.
onSelect(v: SourcedValue) => void—Called with a SourcedValue when its figure is clicked: open its source records.
renderLink(props: AnchorHTMLAttributes<HTMLAnchorElement> & { href: string; 'data-testid'?: string }) => ReactNode—Draws every link the figures, charts and tables print; receives the anchor's props (`href` always set).
<Anchor />1 propsA link through the page's `renderLink` (Next's Link, a router), else a plain anchor.data-testidstring—`data-testid` for the anchor (passed through to `renderLink`).
Also takes the HTML attributes of its root element.
useFlash(text: string): numberRe-triggers a one-shot highlight whenever the displayed text changes after first paint (live refresh).
useStruck(text: string, ms?: number): { text: string; n: number; } | nullStruck and replaced: when the displayed text changes after first paint, the old text, to be shown struck beside the new one for `ms` or until the next change (whichever comes first). `n` changes with every change, to restart the strike's one-shot draw.
useCommandActions(): CommandActionsThe page's `CommandActions` (empty when there is no provider).
Install this free piece now; the Pro pieces drop in on top of it, in the same app. Pro is $79 once.