Kanshō/Metric card

Metric card

Unified metric tile — renders a single KPI with optional delta, trend chart, and legend. Replaces the former Stat card and Analytics card.

Included in the single kansho full pack. Components are not offered as separate installs.

Compact stat row

Cloudflare-style dense KPI tiles
Reasoning
120+4.2%
Tools
137-2.1%
Memory
154+4.2%
Network
171-2.1%
Skills
188+4.2%
Verify
205-2.1%

Default grid

Active runs
42+12.4%
vs last hour
Tokens / hour
1.21M-3.2%
vs last hour
Tokens / hour trend12 data points, starting at 12 and ending at 24.
Spend today
$418of $500+5.7%
approaching cap
Tool errors
2.1%-18.3%
last 24h

Featured panel with legend

Runs per hour
142last 24h+8.4%
vs prior day
p50
5.2s
p95
12.1s
errors
0.6%
Runs per hour trend24 data points, starting at 14 and ending at 78.

Tone variants with trends

Token spend
$1,824last 24h-4.1%
vs prior day
Token spend trend24 data points, starting at 80 and ending at 36.
Tool calls
9,318last 24h+12.6%
Tool calls trend24 data points, starting at 12 and ending at 65.
Failed approvals
6last 24h+50.0%
vs prior day
Failed approvals trend24 data points, starting at 0 and ending at 6.
Latency
82msp95-12.3%
Latency trend12 data points, starting at 120 and ending at 82.

Flat / zero series

A flat series renders a visible baseline, not a blank
Errors today
0
Errors today trend12 data points, starting at 0 and ending at 0.
Constant load
50req/s
Constant load trend12 data points, starting at 50 and ending at 50.

No trend

Plain stat tile — no series prop
Agents online
2
1 idle
Completed today
3
0 failed
Total spend
$1.31
+$0.04/min

Card variants

Surface (default)
42+2.1%
Outline
42+2.1%
Muted
42+2.1%

Included components

This page is the canonical destination for these components. All ship in the single Kansho pack.

Mini chart

components/surfaces/mini-chart.tsx

Supporting sources

These installed helpers belong to components documented on this page. They do not increase the public component count.

components/surfaces/metric-card-tokens.ts

Shared style tokens used by MetricCard and StatusCard.

Component documentation

Metric Card

components/surfaces/metric-card.tsx

Purpose

Summarizes a named metric with value, trend context, and optional visualization.

Appropriate use

Use for dashboard metrics that need a concise value hierarchy and an optional small trend series.

Example

components/surfaces/metric-card.tsx has a representative live example in the "Default grid" section on /components/metric-card.

States

Supports compact or default density, surface, muted, or outline variants, accent, success, warning, or danger chart tones, positive, negative, flat, or absent deltas, and line, area, or bar trends.

API and props

MetricCard accepts label, value, unit, delta, deltaLabel, invertDelta, hint, series, trendVariant, tone, legend, trailing, density, variant, and className.

Dependencies

React, Lucide icons, MiniChart, metric-card token helpers, and the Kansho cn utility.

Accessibility

Keeps the metric label, value, and delta as visible text and passes an accessible description to its chart.

Limitations

It formats display hierarchy rather than raw numbers; callers must supply localized values, delta meaning, and an appropriately sampled series.

Source

Source: components/surfaces/metric-card.tsx.

Full pack

components/surfaces/metric-card.tsx is documented at /components/metric-card and installs only through the single Kansho full pack; no individual component install is offered.

Mini chart

components/surfaces/mini-chart.tsx

Purpose

Draws a compact line, area, or bar trend from a numeric series.

Appropriate use

Use as a supporting sparkline inside a labelled metric or status surface, not as a standalone analytical chart.

Example

components/surfaces/mini-chart.tsx has a representative live example in the "Tone variants with trends" section on /components/metric-card.

States

Supports line, area, and bar variants, accent, success, warning, or danger tones, custom dimensions, empty or flat series, and labelled or decorative rendering.

API and props

MiniChart accepts values, variant, tone, width, height, className, ariaLabel, and accessibleDescription.

Dependencies

React and the Kansho cn utility.

Accessibility

Uses role img with a label and optional description when ariaLabel is supplied, otherwise marks the SVG presentation-only.

Limitations

It has no axes, tooltip, interaction, or value labels; bar series above forty points fall back to a line for legibility.

Source

Source: components/surfaces/mini-chart.tsx.

Full pack

components/surfaces/mini-chart.tsx is documented at /components/metric-card and installs only through the single Kansho full pack; no individual component install is offered.