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

# Number roll

Rolling text: a number or words that spin into their new value, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `NumberRoll`.

## Try it

Change the value up or down (digits count that way) or to words (letters run forward); switch the type size, the end the reels match from, the turns, the unit and the words beside.

The values are ours; under reduced motion the new value stands at once.

## When to use

- Rolling text: a number or words that spin into their new value.

## 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 Number roll 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>/meadow-number-roll.json --yes
```

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

## Usage

```tsx
import { NumberRoll, NumberRollLabel } from '@/components/ui/goop/number-roll';

function DailyAverage({ ms }: { ms: number }) {
  return (
    <div className="flex flex-col items-start gap-0.5">
      <NumberRollLabel className="text-base font-medium text-muted-foreground">Daily average</NumberRollLabel>
      <NumberRoll value={ms} format={(n) => n.toLocaleString()} unit="ms" size="4xl" />
      <p className="text-sm text-muted-foreground">
        Status: <NumberRoll value="Shipped" size="inherit" announce />
      </p>
    </div>
  );
}
```

- Fits: overview: body.
- Also known as: AnimatedNumber.
- width, gap, text, motion: add no class for these.

## API reference

### Options

- `size: sm | base | xl | 4xl | inherit = base`
- `value: number | string` — The value shown: a number, or words.
- `format?: (value: number) => string` — How a number reads: grouped digits in the document's language by default.
- `unit?: string` — The words set small after the value ("ms", "notes").
- `duration?: number` — Each reel's run in milliseconds; the theme's roll duration by default.
- `stagger?: number` — The milliseconds between one reel's start and landing and the next's; the theme's stagger by default.
- `spins?: number = 1` — Whole extra turns a reel makes before it lands: 1 by default; 0 rolls straight to the new character.
- `align?: 'auto' | 'start' | 'end' = 'auto'` — The edge characters are matched from: `auto` (the default) matches a number from its end (its units stay its units) and words from their start; `start` or `end` matches either from that edge.
- `announce?: boolean = false` — Says each new value in a polite live region: for a value that changes without the reader's doing.

### Parts

- `NumberRollLabel` — The words beside a rolling number (its label, its sub-line); children: string — The words; a change crossfades to the new ones

- Class recipes (cva): numberRollVariants (NumberRoll)
- data-slot values (to select a part by): number-roll, number-roll-label, number-roll-reel, number-roll-unit, number-roll-value

## Motion

- The part sets its own motion: add no transition or animation of your own.

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

- [Icon tile](/themes/meadow/components/icon-tile): A small square holding one icon that marks what a row, a card or a step is about.
- [Media frame](/themes/meadow/components/media-frame): A box for a photo, a map, a cover or an upload, at a fixed shape, holding a picture or, until there is one, its empty state.
- [Carousel](/themes/meadow/components/carousel): A strip of pictures that scroll sideways, two in view, with previous and next buttons, for a gallery or a product's photos.
- [Meta facts](/themes/meadow/components/meta-facts): A strip of a record's short facts, such as its status, owner and dates, each a label over its value.
