# Page Indicator

> Pagination dashes you can click, scrub, step with arrows or type into.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Components › Navigation |
| Live preview | https://uibrik.com/components/page-indicator |
| Writes | 1 file into `components/uibrik/page-indicator/` |
| Packages | `@number-flow/react`, `motion`, `react-use-measure` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 9, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/page-indicator.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/page-indicator`.

Can't run commands? https://uibrik.com/components/page-indicator/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { PageIndicator } from "@/components/uibrik/page-indicator/page-indicator";

<PageIndicator
  total={48}
  visible={11}
  defaultPage={6}
  dragStep={14}
  stretch={30}
  showNumber
  onChange={(page) => {}}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/page-indicator.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `total` | `number` | `48` | Number of pages. |
| `visible` | `number` | `11` | Dashes shown at once. |
| `defaultPage` | `number` | `6` | Starting page when uncontrolled. |
| `dragStep` | `number` | `14` | Drag distance per page while scrubbing. |
| `stretch` | `number` | `30` | How far the grabbed dash stretches past either end. |
| `showNumber` | `boolean` | `true` | Show the number pill; click it to type a page. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `onChange` | `(page: number) => void` |  | Called when the page changes. |
| `className` | `string` |  | Classes for the wrapper. |

## Where it fits

- **Onboarding carousels**: Dashes you can click, scrub or step through show progress and allow jumping. Pairs with [Progress Dots](https://uibrik.com/components/progress-dots.md).
- **Slide and step views**: Typing a page number makes long decks easy to navigate.
- **Mobile pagers**: Scrubbing across dashes is fast with one thumb.

## Same shelf: Navigation

- [Pagination](https://uibrik.com/components/pagination.md): Pagination that never changes width: the current-page pill slides between slots, page numbers roll like an odometer when the window shifts, and an ellipsis opens into a jump-to-page field.
- [Progress Dots](https://uibrik.com/components/progress-dots.md): Pagination dots where the active one stretches into a pill that fills as it plays, and the row opens into labelled steps on hover. Also comes as full-width story segments.
- [Search](https://uibrik.com/components/search.md) (Pro): A search pill that grows into a palette with filter chips and results.
- [Section Pill](https://uibrik.com/components/section-pill.md): A floating pill that names the section you're reading, with a ring for how far down the page you are, and opens into the full list, carrying the current title to its row.
- [Tick Nav](https://uibrik.com/components/tick-nav.md): A section list on a ruler whose ticks swell like a dock under the pointer, sliding each label out with its tick.
- [Viscosity Menu](https://uibrik.com/components/viscosity-menu.md) (Pro): A dot that pours into a menu panel like a drop of liquid.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/page-indicator/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
