npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-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 { Badge } from '@/components/ui/goop/badge';
import { Stat, StatGroup, StatLabel, StatTile, StatValue } from '@/components/ui/goop/stat';
function SiteNumbers({ sessions }: { sessions: number }) {
return (
<>
<Stat>
<StatValue>{sessions}</StatValue>
<StatLabel>sessions</StatLabel>
</Stat>
<StatGroup aria-label="The last 30 days">
<StatTile
label="Sessions run"
value="1,284"
trend={
<Badge variant="success" stateLabel="Up">
+6%
</Badge>
}
comparison="vs prior 30 days"
description="52 at new sites"
/>
<StatTile label="No-shows" value="2.1%" description="3 of 142 sessions missed" />
</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 status Badge 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>/meadow-stat.json --yesAdd the Goop Stat to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { Badge } from '@/components/ui/goop/badge';
import { Stat, StatGroup, StatLabel, StatTile, StatValue } from '@/components/ui/goop/stat';
function SiteNumbers({ sessions }: { sessions: number }) {
return (
<>
<Stat>
<StatValue>{sessions}</StatValue>
<StatLabel>sessions</StatLabel>
</Stat>
<StatGroup aria-label="The last 30 days">
<StatTile
label="Sessions run"
value="1,284"
trend={
<Badge variant="success" stateLabel="Up">
+6%
</Badge>
}
comparison="vs prior 30 days"
description="52 at new sites"
/>
<StatTile label="No-shows" value="2.1%" description="3 of 142 sessions missed" />
</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 status Badge; 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 small chart 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.