---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Stat

A big figure with the word for what it counts, for a dashboard tile, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `Stat`.

## Try it

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.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-stat.json --yes
```

```text
Add the Goop Stat to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
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

### Parts

- `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.

## Related

- [Trend chip](/themes/trail/components/trend-chip): A small chip with how much a figure rose or fell.
- [Sparkline](/themes/trail/components/sparkline): One line of a series' shape, as wide as its caller and as tall as the text line it sits in.
- [Status mark](/themes/trail/components/status-mark): A small icon that shows an item's status, such as to do, in progress or done, in a list, a board or a record.
- [Priority mark](/themes/trail/components/priority-mark): A small icon that shows an item's priority, from none to urgent, in a list, a board or a record.
