Metric
A label, one big number and its change. When the value changes the number counts to it through a real odometer: the next wheel up only turns when the one below passes nine, and with per-digit mass each wheel follows on its own spring, heavier per place, so units flick and thousands lumber; wheels too fast to read fade back.
$149 once · every Pro piece
The change is a small drawn chevron, accent when up and grey when down, as a percentage, an absolute step or both. Options: a pilot light by the label that breathes in the accent while the value is fresh and goes ash and still once it is stale (“6m ago”); an inline sparkline that slides left as values arrive, whose hover drops the line back, re-strokes a sprung window round the pointer and rolls the big number to the point under it; loading and empty states.
Install
npx shadcn@latest add @obsyde/metricNeeds your licence key · Get Pro
Usage
Import it from where the CLI puts it, or copy the files below by hand.
import { Metric } from '@/components/obsyde/ember/metric/Metric';
export function Example() {
return (
<Metric label="Count" />
);
}
Files
What you get with Pro: plain React, TypeScript and CSS, with no dependencies.
ember/metric/Metric.tsxcomponentember/metric/metric.cssstylesember/metric/metric-demo.cssstylesember/metric/MetricDemo.tsxdemoember/viz-kit/viz-kit.csssharedember/viz-kit/size.tssharedember/viz-kit/shape.tssharedember/viz-kit/scale.tssharedember/viz-kit/patterns.tsxsharedember/viz-kit/motion.tssharedember/shared/spring.tssharedember/shared/accent.tssharedember/shared/RollingNumber.tsxsharedember/shared/rolling-number.csssharedember/shared/ember.csssharedember/viz-kit/touch.tsshared
API
| Prop | Type | Default |
|---|---|---|
accentAccent | 'ember' | 'volt' | 'arc' | 'ember' |
valueValue | number | 12408 |
previousPrevious | number | 11906 |
labelLabel | string | 'Count' |
unitUnit | string | — |
deltaFormatChange as | 'percent' | 'absolute' | 'both' | 'percent' |
pilotPilot light | 'none' | 'fresh' | 'stale' | 'none' |
massDigit mass | boolean | true |
sparklineSparkline | boolean | false |
changingChanging | boolean | false |
rowRow of three | boolean | false |
sizeSize | 'md' | 'lg' | 'lg' |
statusStatus | 'ready' | 'loading' | 'empty' | 'ready' |
seedSeed | number | 1 |