Metric Delta

A tiny percentage change indicator with an up arrow in green for gains and a down arrow in red for losses. Pair it with stat cards, KPI tiles and table cells.

src/registry/ui/metric-delta.tsx/r/metric-delta.json
12%4%

Up / down

Installation#

bash
npx shadcn@latest add @minidev/metric-delta

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/metric-delta.json

Usage#

tsx
import { MetricDelta } from "@/components/ui/metric-delta"

export function Example() {
  return (
    <MetricDelta value={12.4} />
  )
}

API reference#

MetricDelta props
PropTypeDefault
value*number-
classNamestring-

* required

Dependencies#

npm

lucide-react

Built from

No other MiniDev files

Examples#

All dashboard components

Learn more