npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-stat.json --yesStat
ProA big figure with the word for what it counts, for a dashboard tile, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- StatValueThe number, as the caller wants it read (a string or a number
- StatLabelThe word after the number that says what it counts
- StatTileA metric tile
- StatGroupA row of metric tiles that wraps on a narrow width
import { Stat, StatValue, StatLabel, StatTile, StatGroup } from '@/components/ui/goop/stat';
import { TrendChip } from '@/components/ui/goop/trend-chip';
import { Sparkline } from '@/components/ui/goop/sparkline';
<>
<Stat>
<StatValue>42</StatValue>
<StatLabel>notes</StatLabel>
</Stat>
<StatGroup aria-label="The last 30 days">
<StatTile
label="Active members"
value="1,284"
trend={<TrendChip value={6} />}
comparison="vs prior 30 days"
description="52 joined"
spark={<Sparkline values={[1080, 1102, 1130, 1190, 1240, 1284]} label="Active members, rising" dot />}
/>
<StatTile
label="Churn"
value="2.1%"
trend={<TrendChip value={-8} good="down" />}
comparison="vs prior 30 days"
description="3 of 142 accounts cancelled"
/>
</StatGroup>
</>Change the number (42 to 43 moves one digit) and the label. The numbers are ours.
When to use
- A big figure with the word for what it counts, for a dashboard tile.
- Also called: KPI or metric card.
When not to use
- To show how much a figure rose or fell, put a TrendChip beside it.
Installation
Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Stat on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-stat.json --yesAdd the Goop Stat to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { Stat, StatValue, StatLabel, StatTile, StatGroup } from '@/components/ui/goop/stat';
import { TrendChip } from '@/components/ui/goop/trend-chip';
import { Sparkline } from '@/components/ui/goop/sparkline';
<>
<Stat>
<StatValue>42</StatValue>
<StatLabel>notes</StatLabel>
</Stat>
<StatGroup aria-label="The last 30 days">
<StatTile
label="Active members"
value="1,284"
trend={<TrendChip value={6} />}
comparison="vs prior 30 days"
description="52 joined"
spark={<Sparkline values={[1080, 1102, 1130, 1190, 1240, 1284]} label="Active members, rising" dot />}
/>
<StatTile
label="Churn"
value="2.1%"
trend={<TrendChip value={-8} good="down" />}
comparison="vs prior 30 days"
description="3 of 142 accounts cancelled"
/>
</StatGroup>
</>- Fits: overview (its recipe).
- width, gap, text: add no class for these.
API reference
| Part | What it is |
|---|---|
| StatValue | The number, as the caller wants it read (a string or a number; 0 is drawn) |
| StatLabel | The word after the number that says what it counts |
| StatTile | A metric tile; label: ReactNode — The title over the figure: what it counts; value: ReactNode — The figure (a string or a number; 0 is drawn); trend?: ReactNode — The change under the figure: a TrendChip; comparison?: ReactNode — What the change compares with ("vs prior 30 days"); description?: ReactNode — The sub-line at the tile's foot ("4 new"); spark?: ReactNode — A Sparkline at the foot's end |
| StatGroup | A row of metric tiles that wraps on a narrow width |
- data-slot values (to select a part by): stat, stat-group, stat-group-list, stat-label, stat-tile, stat-tile-content, stat-tile-description, stat-tile-footer, stat-tile-row, stat-tile-spark, stat-tile-text, stat-value, stat-value-item
Notes for AI
Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.