Weftv0.4.0
GitHubFigma
Blade AI
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

#preview

Change 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-states

Trend up, status check, text only and trend down, each default, hover, focus and loading, from the KPI Card artboard.

KPI Card · 4 variants × default, hover, focus, loading
Runs this year
11
Since your first run in May
Across 8 closed runs
Trend up · progress · Default
Runs this year
11
Since your first run in May
Across 8 closed runs
Trend up · progress · Hover
Runs this year
11
Since your first run in May
Across 8 closed runs
Trend up · progress · Focus
Trend up · progress · Loading
Average match rate
91.2%
Up from 86.7% in your first run
Across 8 closed runs
Status check · progress · Default
Average match rate
91.2%
Up from 86.7% in your first run
Across 8 closed runs
Status check · progress · Hover
Average match rate
91.2%
Up from 86.7% in your first run
Across 8 closed runs
Status check · progress · Focus
Status check · progress · Loading
Items open across runs
154
130 in Run #128 · 24 in Run #127
Clear them to close each period
Text only · no progress · Default
Items open across runs
154
130 in Run #128 · 24 in Run #127
Clear them to close each period
Text only · no progress · Hover
Items open across runs
154
130 in Run #128 · 24 in Run #127
Clear them to close each period
Text only · no progress · Focus
Text only · no progress · Loading
Average time to close
3.2 days
Down from 4.5 days in Q2
Average across 8 closed runs
Trend down · progress · Default
Average time to close
3.2 days
Down from 4.5 days in Q2
Average across 8 closed runs
Trend down · progress · Hover
Average time to close
3.2 days
Down from 4.5 days in Q2
Average across 8 closed runs
Trend down · progress · Focus
Trend down · progress · Loading

Props

#props

Read 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

#usage

Short 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

#accessibility

A 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.