---
title: "Count Up"
description: "Counts a number up from a start value when it scrolls into view, so a stat on a page gets noticed. The number uses the format of the reader's locale."
url: https://gelatinui.com/components/count-up
markdown_url: https://gelatinui.com/components/count-up.md
access: free
install: "npx shadcn@latest add @gelatin-ui/count-up"
registry_item: https://gelatinui.com/r/count-up.json
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Count Up

> Counts a number up from a start value when it scrolls into view, so a stat on a page gets noticed. The number uses the format of the reader's locale.

Page: https://gelatinui.com/components/count-up

## When to use it

Best for: A marketing number or a total that counts once when it comes into view.

- Pass `to`, and `from` when it does not start at 0.
- Pass `format` for a currency, a percent, or a compact count.
- Use `trigger="manual"` with `start` to start it from code.

## When not to use it

- For a value that changes often, use a [Rolling Number](https://gelatinui.com/components/rolling-number.md).

## Notes for agents

- Set `locale`, so the server render and the first browser render write the same number.
- A new `to` counts on from the shown value.
- `once` stops it from counting again when it comes back into view.
- `onComplete` runs when the count ends, also for 0 to 0.

## Anatomy

```text
CountUp
```

## API reference

### CountUp

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `from` | `number \| bigint` | 0 | The number it shows before the count. Default: 0. |
| `to` | `number \| bigint` |  | The number it counts to. A smaller `to` counts down. A new `to` counts on from the shown value. |
| `locale` | `string` |  | The BCP 47 locale of the digits and marks ("de-DE"). Default: the `DisplayLocaleProvider` locale, else `"en-US"` (`useDisplayLocale`). Never the browser language, so a server render and the first browser render write the same number. |
| `format` | `NumberFormatOptions` |  | The options of `Intl.NumberFormat` (`style`, `currency`, `notation`, the fraction digits, `signDisplay`, and the others). The count shows every number in the format of `to`: its symbols and fraction digits, so 0 → "$2.4M" counts "$0.0M", "$0.1M", … "$2.4M". |
| `duration` | `number` | COUNT_UP_DURATION | The length of the count in ms. Default: 1600. |
| `ease` | `Easing[] \| Easing` | EASE_PANEL | The curve of the count: a Motion easing name (`"linear"`, `"easeOut"`, `"circOut"`, `"backOut"`) or a cubic-bezier array. Default: `ease-panel` (0.2, 0.4, 0.2, 1), which starts at once and slows evenly into the last digit. |
| `delay` | `number` | 0 | The wait in ms between the trigger and the count. Default: 0. |
| `trigger` | `"in-view" \| "manual" \| "mount"` | "in-view" | What starts the count. `in-view` (the default): half of the number is in the viewport. `mount`: at once. `manual`: when `start` is true. |
| `start` | `boolean` | false | With `trigger="manual"`: true starts the count, false shows `from` again. |
| `once` | `boolean` | true | With `trigger="in-view"`: true (the default) counts the first time only. False shows `from` again when the number leaves the view, and counts again when it comes back. |
| `onComplete` | `function` |  | Runs when the count reaches `to`. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| CountUp | `count-up` |  | `--count-up-shift` |  |

## Usage

Pass the end value.

```tsx title="signups-stat.tsx"
import { CountUp } from "@/components/text/count-up";

export function SignupsStat() {
  return <CountUp to={12840} locale="en-US" className="text-4xl font-semibold" />;
}
```

## Compose

Build it with:

- [Workspace](https://gelatinui.com/components/workspace.md): Holds the app shell: the sidebar and the page.
- [Frame](https://gelatinui.com/components/frame.md): Groups a row of numbers or a summary.
- [Data List](https://gelatinui.com/components/data-list.md): Shows label and value pairs.
- [Badge](https://gelatinui.com/components/badge.md): Shows a level or a status next to a number.
- [Timeline](https://gelatinui.com/components/timeline.md): Shows the recent activity.

Rules:

- Depth from layers (`layered-neutrals`): Show depth with one step of the neutral tokens (page, card, muted) or one soft shadow, not with many borders or strong shadows.
- Color has a job (`color-has-a-job`): Use color only for a status, the brand action, or data; keep the rest neutral, and show a level with a small mark (a dot, a tinted badge) before a big fill.
- Real content (`real-content`): Fill the UI with content of the real product (real names, amounts, dates, and states), never lorem text or "Item 1".
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

Patterns: `gelatin://patterns/dashboard-overview`

## Add it

```bash
npx shadcn@latest add @gelatin-ui/count-up
```

It adds 21 registry items: 20 files, 4196 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `xstate`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Rolling Number](https://gelatinui.com/components/rolling-number.md)
- [Countdown](https://gelatinui.com/components/countdown.md)

## Accessibility

The final number is in the text, so a screen reader reads the value and not the count.

Digits keep their width, so nothing around it moves.

## Motion

| Part | Motion |
| --- | --- |
| Count | panel · 1600ms by default · `duration` and `ease` change it |
