Ballmac UI home

Stat Card

A metric card with a clear comparison trend, optional visual, and readable value hierarchy.

Monthly active workspaces
12,840
Improving: 12.8%from last month

Installation

$ pnpm dlx shadcn@latest add @ballmac/stat-card

Usage

import { StatCard } from "@/components/ballmac/stat-card"

The full example is in the Code tab above.

Examples

States and variants

Response time
84 ms
Improving: 18%versus last week
Open issues
7
Worsening: 3%versus last week

API reference

PropTypeDefault
label*

Short metric label.

string—
value*

Formatted value, including any unit or currency symbol.

React.ReactNode—
change

Signed percentage change from the comparison period.

number—
comparison

Description of the comparison period.

string—
lowerIsBetter

Whether a smaller value is the desired outcome.

booleanfalse
visual

Optional small chart or icon at the right.

React.ReactNode—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
NoneStatic content is announced with semantic structure

Use with AI

A metric card with a clear comparison trend, optional visual, and readable value hierarchy. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Stat Card (@ballmac/stat-card) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Track a key metric with a comparison period

Not for

  • Use Kpi Row for several compact metrics

Registry JSON: https://ui.ballmac.com/r/stat-card.json

Credits

Free to use in personal and commercial projects.

Registry
shadcn/utils