uibrik

KPI Tile

New

Preview

Customize

Accent
Days30

Usage

import { KpiTile } from "@/components/uibrik/kpi-tile/kpi-tile";

<KpiTile />

Installation

npx shadcn@latest add https://uibrik.com/r/kpi-tile.json
Adds the files to components/uibrik/kpi-tile and installs @number-flow/react, @tabler/icons-react, motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/kpi-tile.

Props

KpiTile
title
Type string
"Revenue"
Names the metric.
deltaLabel
Type string
"vs last month"
What the change is measured against.
invert
Type boolean
false
Lower is better (churn, latency, cost), so a fall reads as good.
area
Type boolean
true
Wash under the line.
accent
Type string
""
Line colour. Empty uses the chart palette.
data
Type { label: string; value: number }[]
–
One point per period, oldest first. The last point is the current value.
value
Type number
–
Headline value. Defaults to the last point.
delta
Type number
–
Change as a fraction (0.124 is +12.4%). Defaults to the last point against the first.
format
Type Intl.NumberFormatOptions
USD currency
Formats every number, e.g. { style: "percent" }.
className
Type string
–
Classes for the outer shell.