---
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/"
---

# Trend chip

A small chip with how much a figure rose or fell, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `TrendChip`.

## Try it

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.

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

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

## Usage

```tsx
import { TrendChip } from '@/components/ui/goop/trend-chip';

<>
  <TrendChip value={12} />
  <TrendChip value={-8} good="down" />
  <TrendChip value={14} good="neither" />
  <TrendChip value={0.4} flatBelow={1} />
  <TrendChip direction="up">12%</TrendChip>
</>
```

- Fits: overview (its recipe).
- text: add no class for these.

## API reference

### Options

- `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 in the good colour (a falling cost is good): `up` by default.
- `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.

## 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

- [Stat](/themes/trail/components/stat): A big figure with the word for what it counts, for a dashboard tile.
- [Number roll](/themes/trail/components/number-roll): A number or a few words that roll into their new value when it changes.
- [Icon tile](/themes/trail/components/icon-tile): A small square holding one icon that marks what a row, a card or a setting is about, tinted for a status.
- [Media frame](/themes/trail/components/media-frame): A box for a photo, a map, a cover or an upload, at a fixed shape.
