npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-trend-chip.json --yesTrend chip
ProA small chip with how much a figure rose or fell, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
import { Stat, StatLabel, StatValue } from '@/components/ui/goop/stat';
import { TrendChip } from '@/components/ui/goop/trend-chip';
function SignupsFigure() {
return (
<div className="flex flex-col gap-2">
<div className="flex items-center gap-2">
<Stat>
<StatValue>1,284</StatValue>
<StatLabel>sign-ups</StatLabel>
</Stat>
<TrendChip value={12} />
</div>
<div className="flex flex-wrap items-center gap-2">
<TrendChip value={-8} good="down" />
<TrendChip value={14} good="neither" />
<TrendChip value={0.4} flatBelow={1} />
<TrendChip direction="up">3.4 pts</TrendChip>
</div>
</div>
);
}Switch the trend up, down or flat, say whether up is good, drop the sign, change the amount: the colour and the icon follow. Look puts the chip in a line, after a big number, on a card, or under the number in a column. The numbers are ours.
When to use
- A small chip with how much a figure rose or fell.
- Also called: delta badge or change indicator.
When not to use
- For the figure itself, use Stat.
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 Trend chip 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-trend-chip.json --yesAdd the Goop Trend chip to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { Stat, StatLabel, StatValue } from '@/components/ui/goop/stat';
import { TrendChip } from '@/components/ui/goop/trend-chip';
function SignupsFigure() {
return (
<div className="flex flex-col gap-2">
<div className="flex items-center gap-2">
<Stat>
<StatValue>1,284</StatValue>
<StatLabel>sign-ups</StatLabel>
</Stat>
<TrendChip value={12} />
</div>
<div className="flex flex-wrap items-center gap-2">
<TrendChip value={-8} good="down" />
<TrendChip value={14} good="neither" />
<TrendChip value={0.4} flatBelow={1} />
<TrendChip direction="up">3.4 pts</TrendChip>
</div>
</div>
);
}- text: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| value? | number | The change in format's unit (6 is a 6% rise under percent): its sign picks the direction, its size is the amount unless children gives other words. |
| format? | 'percent' | 'number' = 'percent' | How value is written: percent (6 reads 6%, the default) or number (1200 reads 1,200). |
| flatBelow? | number = 0 | The size under which value reads as no change (0.5: a move of 0.4 is level); 0 by default, so only 0 is. |
| direction? | 'up' | 'down' | 'flat' | The way the number moved, said by hand where no value is given: up, down, or flat (no change, the default). |
| good? | 'up' | 'down' | 'neither' = 'up' | Which direction is good, and so paints its arrow and amount in the good colour (a falling cost is good): up by default; the other direction reads in the muted grey. |
| sign? | boolean = true | Write the sign before the amount (+ for a rise, − for a fall); false when the caller's amount holds one. |
| upLabel? | string = 'up' | The word a reader hears before a rise's amount. |
| downLabel? | string = 'down' | The word a reader hears before a fall's amount. |
| flatLabel? | string = 'no change' | The word a reader hears before the amount of no change. |
| children? | ReactNode | The amount, as the caller formats it ("8%", "3.4 pts"); with a value, words in place of its written size. |
- data-slot values (to select a part by): trend-chip, trend-chip-icon, trend-chip-value
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.