Controls

Stat Tile

Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Stat Tile

Stat Tile

A soft card with one headline number, its change and a small trend line.

Installation

npx shadcn@latest add ikislay/pixel-ui/stat-tile

How to use

import { StatTile } from "@/components/ui/stat-tile"
export function Demo() {
return (
<StatTile
label="Revenue"
value={48210}
change={12.4}
caption="vs last month"
trend={[31, 34, 33, 38, 41, 40, 46, 48]}
format={(n) => "$" + Math.round(n).toLocaleString()}
/>
)
}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
label*
string

What the number measures.

value*
number

The headline number.

change
number

The change in percent, like 12.4 or -3. Hidden when unset.

caption
string

A short note after the change, like vs last month.

trend
number[]

Recent values, oldest first, drawn as a small line beside the number.

format
(value: number) => string

Formats the headline number. Defaults to short numbers like 12.4K.

invert
boolean

Treats a fall as good news, for measures like churn or load time.

color
string

Any CSS color for the trend line.

className
string

Merged onto the root element.