Metric Card

A spotlight card with a counting number and a sparkline that draws itself.

Install it the shadcn way: copy the source file into your project. It uses CSS 3D, Tailwind CSS v4 and Framer Motion, no WebGL.

MetricCard props

PropTypeDefaultDescription
labelstringName of the metric, shown above the value.
valuenumberCurrent value of the metric. Counts up when shown.
prefixstringText before the value, e.g. "
quot;.
suffixstringText after the value, e.g. "%".
decimalsnumberNumber of digits shown after the decimal point.
deltanumberChange versus the previous period, in percent.
datanumber[]Points for the sparkline. At least two.
classNamestringExtra classes added to the outer element.

More components

Guides

Start

Cards

Scenes

Controls & text

Buttons

More cards

UI elements

Form controls

App components

Text & backgrounds

Showpieces

Blocks