Active users
+12%
24,180
Last 30 days
A number with its context, change and a small trend line.
pnpm dlx shadcn@latest add https://caliperui.site/r/metric.json+12%
24,180
Last 30 days
pnpm dlx shadcn@latest add https://caliperui.site/r/metric.json
Adds its 3 files to components/ui/, each with its own stylesheet, and installs their packages. No account needed. The first part also adds Caliper UI’s tokens; import them once as in Installation.
This is the code behind the preview above.
import { Metric } from "@/components/ui/metric" export function ActiveUsers() { return ( <div className="w-full max-w-xs"> <Metric label="Active users" value="24,180" context="Last 30 days" change="+12%" series={[12, 14, 13, 18, 17, 21, 24]} /> </div> ); }
Also accepts the native props of its root element and a ref.
It is built on native elements, so roles and focus come from the browser.
No custom key handling; Tab and the native activation keys do the work.
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.