Display · KPI Cardstable
KPI Card
A headline metric with a trend, an optional progress bar and a footnote. Trend up, down or check, primary or neutral accent, a loading skeleton and an interactive form that becomes a button.
Preview
#previewChange the options and the code follows. Show code opens the React snippet.
Runs this year
11
Since your first run in May
Across 8 closed runs
kpi-card-example.tsx
import { KpiCard } from "@blade-ai/weft/components/kpi-card";
<KpiCard
label="Runs this year"
value="11"
trend="up"
trendText="Since your first run in May"
progress={60}
footnote="Across 8 closed runs"
/>All states
#all-statesTrend up, status check, text only and trend down, each default, hover, focus and loading, from the KPI Card artboard.
Props
#propsRead from the component source. Booleans are is-prefixed. A star marks a required prop.
Prop
Type
Default
Description
label *
string
—
Metric name, shown small above the value.
value *
ReactNode
—
The headline figure.
trend
"up" | "down" | "check" | "none"
"none"
Icon before the trend text: arrow up (positive), arrow down (negative) or a check (status). "none" hides it.
trendText
ReactNode
—
Sentence beside the trend icon.
progress
number
—
0 to 100. Draws the 2px progress bar; omit for text-only cards.
footnote
ReactNode
—
Small caption under the bar, or under the trend text when there is no bar.
accent
"primary" | "neutral"
"primary"
"primary" colours the label dot and bar with the brand colour; "neutral" uses grays (status cards).
isLoading
boolean
false
Shows skeleton blocks instead of content and sets aria-busy.
onClick
(event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>) => void
—
Makes the whole card a button with hover and focus styles.
Usage
#usageShort rules for choosing and writing kpi card.
Do
Lead with the number and name the metric in the label.
Use the trend text to say what changed and since when.
Use the neutral accent for status cards and the primary accent for progress.
Don't
Put more than one metric in a card.
Make the card interactive and add controls inside it.
Show a progress bar for a metric that has no target.
Accessibility
#accessibilityA group of text. Interactive cards are buttons. Loading cards are marked busy.
Keyboard
Key
Action
Enter / Space
Activates an interactive card.
Tab
Moves focus to an interactive card.
ARIA
Element
Role / attribute
When
Interactive card
role="button" · tabindex 0
When onClick is set and not loading.
Loading card
aria-busy="true"
isLoading shows skeleton blocks.
Trend icon
aria-hidden="true"
The trend text carries the meaning.