KPI
A key number as a card, with its change and the picture that says what it means, such as a trend, a target, a score, a breakdown, a live count or a strip of days.
Examples
Trend
The value against the same days of the period before, dashed behind it. A new month rolls every number from where it was and moves the line to its new shape.
Target
Progress to a goal, with the pale stretch where an even pace would be by now, so On track or Behind pace reads at a glance.
Budget
A limit to stay under: with better="lower" and kind="limit", spending ahead of the pace turns amber, and passing the limit red.
Score
A value judged in bands, such as a Web Vital at P75: the band it is in lights, and each band’s end is marked under the joins.
Breakdown
What the value is made of, as one bar of parts with each part’s count and share. A rate’s change is in percentage points.
Live
A count that is still coming in: partial dashes the minute still counting, and the value rolls as each one arrives.
Status history
The state of each day, such as a service’s uptime: the keys step through the days, each read as its state.
Installation
npx shadcn@latest add https://kinoui.com/r/kpi.json- Files
lib/number-format.tslib/reduce-motion.tslib/refs.tslib/resize.tslib/roll.tsxlib/swap.tsxlib/run-progress.tscomponents/kino/animated-number.tsxcomponents/kino/badge.tsxlib/dates.tslib/chart-math.tslib/chart-scale.tslib/chart-frame.tslib/chart-bar-marks.tslib/live.tsxlib/chart-live.tslib/chart-live-clock.tsxlib/scroll.tslib/popup.tslib/glide.tsxlib/keys.tsxcomponents/kino/kbd.tsxcomponents/kino/tooltip.tsxlib/cut.tsxlib/announce.tscomponents/kino/spinner.tsxcomponents/kino/button.tsxlib/controllable.tslib/chart-root.tsxlib/chart-state.tslib/chart-agent.tslib/chart-base.tsxlib/chart-cartesian-reader.tslib/chart-cartesian.tsxlib/chart-list.tsxlib/chart-list-reader.tslib/chart-tree-reader.tslib/chart-flow-reader.tslib/chart-grid-reader.tslib/highlight.tscomponents/kino/chart.tsxlib/placeholder.tslib/chart-bars.tsxcomponents/kino/bar-chart.tsxlib/grip.tslib/panel.tsxcomponents/kino/card.tsxcomponents/kino/skeleton.tsxlib/line-path.tslib/chart-line-marks.tslib/chart-area-marks.tslib/area-fill.tsxlib/chart-line.tsxcomponents/kino/area-chart.tsxcomponents/kino/line-chart.tsxcomponents/kino/sparkline.tsxlib/track.tscomponents/kino/kpi.tsx- Packages
@ui-sdk/core@ui-sdk/reactclass-variance-authorityd3-arrayd3-shape- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
The CLI keeps any of these colours your project already has, such as the chart colours shadcn init writes. To use Kino’s, set them in your global CSS:
:root { --chart-1: oklch(0.42 0.1 248); --chart-2: oklch(0.53 0.12 222); --chart-3: oklch(0.6 0.11 185); --chart-4: oklch(0.65 0.17 132); --chart-5: oklch(0.72 0.154 106.7); --chart-accent: oklch(0.795 0.171 71.2);}.dark { --chart-1: oklch(0.6 0.15 255); --chart-2: oklch(0.7 0.13 222); --chart-3: oklch(0.79 0.13 185); --chart-4: oklch(0.82 0.15 128); --chart-5: oklch(0.72 0.154 106.7); --chart-accent: oklch(0.795 0.171 71.2);}API reference
Kpi
A Card that holds the number every part reads: the value, the one before, how to write them and whether up is good.
KpiHeader
The label and an action, on one row.
KpiLabel
What the number is, an <h3> as CardTitle is. It names the target’s and the score’s meters; each chart takes its own label.
KpiAction
A control or a status at the end of the header, such as a period picker or KpiLive.
KpiContent
The figure and the picture under it. The picture sits at the bottom, so the pictures of a row of KPIs line up.
KpiFigure
The value and its change, one under the other.
KpiValue
The value, written with the KPI’s format. A new value rolls from the old one.
KpiChange
The change from previous as a badge, toned by better, whose arrow turns to the new direction, then its children as the comparison, such as “vs Oct”. A change too small to show is flat, and with a zero before a share, it reads “New”. Nothing shows when value or previous is missing.
KpiTrend
A Sparkline of the value over its period, and its other props. The day under the pointer or the keys reads in a tooltip under it, never over the value.
KpiTarget
Progress to a target as a bar with a notch at the target, the share of it and a status in words. A ui-sdk Meter.
KpiScore
The value on a scale of bands, such as Good, Needs improvement and Poor: the band it is in lights, its name shows above, and a marker sits at the value. A ui-sdk Meter.
KpiBreakdown
The parts of the value, as one bar, and a legend with each part’s count and share.
KpiHistory
A strip of days, each coloured by its state, from the Bar chart, and its other props: the day under the pointer stays bright and its state reads in a tooltip.
KpiLive
A dot that breathes and “Live”, or its children, for a value that is still coming in.
KpiFooter
Small print at the card’s foot, such as the period or when it last updated.
Data attributes
Accessibility
- The label is a heading, and it names the target’s and the score’s meters, so one reads as “Q4 sales, meter, 72% of $150,000, On track”. A trend or a strip of days is named by its own
label. - The change says its direction in words, “Up” or “Down”, besides the arrow and the colour, and a missing value says “No data”.
- The target and the score are meters with their value in words, the breakdown is a list of each part’s count and share, and the trend and the strip of days are sliders the arrow keys step through.
- Nothing announces itself while a live value ticks, so a screen reader isn’t interrupted every second.
For agents
What an agent reads on this example with snapshot(), and the actions it can call with act().
The Agent bridge page sets up snapshot() and act() in your app.