---
title: "Pagination"
description: "Page links for a long list, such as orders or search results, with Previous and Next. The row keeps its width as you move."
url: https://gelatinui.com/components/pagination
markdown_url: https://gelatinui.com/components/pagination.md
access: free
install: "npx shadcn@latest add @gelatin-ui/pagination"
registry_item: https://gelatinui.com/r/pagination.json
version: "2026-11-08"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Pagination

> Page links for a long list, such as orders or search results, with Previous and Next. The row keeps its width as you move.

Page: https://gelatinui.com/components/pagination

## When to use it

Best for: Links to the pages of a long list, with Previous, Next, and a page window that keeps its width.

- Use it when a list loads one page at a time, with a URL per page.
- Render router links through `render` on each link.
- Add `className="mx-0 w-auto"` to put it at the end of a table footer.

## When not to use it

- To show where a page sits in the site, use a [Breadcrumb](https://gelatinui.com/components/breadcrumb.md).
- For views of one thing in one place, use [Tabs](https://gelatinui.com/components/tabs.md).

## Notes for agents

- Mark the current page with `isActive`; it sets `aria-current="page"`.
- Show 7 page slots with `PaginationEllipsis`, so the row width does not change.
- Below `sm`, Previous and Next drop their text and become 32px squares.

## Anatomy

```text
Pagination
├─ PaginationContent (0..n)
├─ PaginationItem (0..n)
├─ PaginationLink (0..n)
├─ PaginationPrevious (0..n)
├─ PaginationNext (0..n)
└─ PaginationEllipsis (0..n)
```

## API reference

### Pagination

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `aria-label` | `string` |  | Defines a string value that labels the current element. The name of the landmark for screen readers. Default "pagination". Translate it. |

### PaginationContent

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### PaginationItem

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### PaginationLink

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` | "icon" |  |
| `isActive` | `boolean` | false | The current page: the `outline` Button look, `aria-current="page"`, and `data-active`. |
| `variant` | `"ghost" \| "outline"` |  | The Button look. By default `ghost`, and `outline` when `isActive`. Set `outline` for the edge links of a compact phone row ("Phone compact" story), where a ghost square has no edge. |
| `disabled` | `boolean` | false | An edge link with no page to go to (Previous on page 1). It keeps its place at 50%, has no `href` (so Tab skips it), and gets `role="link"` with `aria-disabled`. A `render` link that brings its own `href` (a router `Link`) keeps it, because the props of the `render` element win; so a disabled link also leaves the tab order (`tabIndex={-1}`) and cancels a click. |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

### PaginationPrevious

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `isActive` | `boolean` |  | The current page: the `outline` Button look, `aria-current="page"`, and `data-active`. |
| `variant` | `"ghost" \| "outline"` |  | The Button look. By default `ghost`, and `outline` when `isActive`. Set `outline` for the edge links of a compact phone row ("Phone compact" story), where a ghost square has no edge. |
| `disabled` | `boolean` |  | An edge link with no page to go to (Previous on page 1). It keeps its place at 50%, has no `href` (so Tab skips it), and gets `role="link"` with `aria-disabled`. A `render` link that brings its own `href` (a router `Link`) keeps it, because the props of the `render` element win; so a disabled link also leaves the tab order (`tabIndex={-1}`) and cancels a click. |
| `size` | `"default" \| "lg" \| "sm"` | "default" | The Button text size: `sm` 28px, `default` 32px, `lg` 36px high. |
| `text` | `string` | "Previous" | The visible text. Translate it. It hides below `sm`; the `aria-label` stays. |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

### PaginationNext

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `isActive` | `boolean` |  | The current page: the `outline` Button look, `aria-current="page"`, and `data-active`. |
| `variant` | `"ghost" \| "outline"` |  | The Button look. By default `ghost`, and `outline` when `isActive`. Set `outline` for the edge links of a compact phone row ("Phone compact" story), where a ghost square has no edge. |
| `disabled` | `boolean` |  | An edge link with no page to go to (Previous on page 1). It keeps its place at 50%, has no `href` (so Tab skips it), and gets `role="link"` with `aria-disabled`. A `render` link that brings its own `href` (a router `Link`) keeps it, because the props of the `render` element win; so a disabled link also leaves the tab order (`tabIndex={-1}`) and cancels a click. |
| `size` | `"default" \| "lg" \| "sm"` | "default" | The Button text size: `sm` 28px, `default` 32px, `lg` 36px high. |
| `text` | `string` | "Next" | The visible text. Translate it. It hides below `sm`; the `aria-label` stays. |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

### PaginationEllipsis

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"icon" \| "icon-lg" \| "icon-sm"` | "icon" | The box of the page links next to it: `icon-sm` 28px, `icon` 32px (default), `icon-lg` 36px. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Pagination | `pagination` |  |  |  |
| PaginationContent | `pagination-content` |  |  |  |
| PaginationItem | `pagination-item` |  |  |  |
| PaginationLink | `pagination-link` | `data-active`, `data-pill` |  | `hit-area` |
| PaginationPrevious | `pagination-previous` | `data-size` |  |  |
| PaginationNext | `pagination-next` | `data-size` |  |  |
| PaginationEllipsis | `pagination-ellipsis` | `data-size` |  |  |

## Usage

Put one `PaginationItem` per link, and mark the current page with `isActive`.

```tsx title="orders-pagination.tsx"
import {
  Pagination,
  PaginationContent,
  PaginationEllipsis,
  PaginationItem,
  PaginationLink,
  PaginationNext,
  PaginationPrevious,
} from "@/components/ui/pagination";

export function OrdersPagination() {
  return (
    <Pagination>
      <PaginationContent>
        <PaginationItem>
          <PaginationPrevious href="/orders?page=1" />
        </PaginationItem>
        <PaginationItem>
          <PaginationLink href="/orders?page=1">1</PaginationLink>
        </PaginationItem>
        <PaginationItem>
          <PaginationLink href="/orders?page=2" isActive>
            2
          </PaginationLink>
        </PaginationItem>
        <PaginationItem>
          <PaginationEllipsis />
        </PaginationItem>
        <PaginationItem>
          <PaginationNext href="/orders?page=3" />
        </PaginationItem>
      </PaginationContent>
    </Pagination>
  );
}
```

## Compose

Build it with:

- [Filters](https://gelatinui.com/components/filters.md): Narrows the records.
- [Data Table](https://gelatinui.com/components/data-table.md): Shows the records in rows, with sort and select.
- [Badge](https://gelatinui.com/components/badge.md): Shows the status of each record.
- [Menu](https://gelatinui.com/components/menu.md): Holds the actions of one row.
- [Empty](https://gelatinui.com/components/empty.md): Shows when no record matches, with a next action.
- [Skeleton](https://gelatinui.com/components/skeleton.md): Holds the layout while the rows load.

Rules:

- Touch targets (`touch-targets`): Give every control a hit area of at least 44 px on touch screens, even when it looks smaller.
- 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.
- 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".

Patterns: `gelatin://patterns/data-list`

## Add it

```bash
npx shadcn@latest add @gelatin-ui/pagination
```

It adds 18 registry items: 15 files, 2844 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@phosphor-icons/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Button](https://gelatinui.com/components/button.md)

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

- [Table](https://gelatinui.com/components/table.md)
- [Button](https://gelatinui.com/components/button.md)
- [Breadcrumb](https://gelatinui.com/components/breadcrumb.md)

## Accessibility

It is a `nav` landmark. The current page has `aria-current="page"`.

A disabled Previous or Next leaves the tab order. Each touch area is 44px high.
