# Pagination

Page keys with previous, next and ellipses, and a position readout.

[View Pagination on CyberSpec](https://www.cyberspec.dev/components/sidebar/pagination)

## Component

Pagination belongs to the Actions group in the CyberSpec catalog. It uses @ui-sdk/react/pagination.

## Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

```sh
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/pagination.json
```

## Example

```tsx
"use client"

import { Pagination } from "@/components/ui/pagination"

export default function PaginationDemo() {
  return (
    <>
      <Pagination label="Archive pages" pageCount={12} defaultPage={3} />
    </>
  )
}
```

## Install this example

```sh
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/pagination-demo.json
```

## Resources

- [Interactive Pagination preview](https://www.cyberspec.dev/preview/pagination)
- [Component catalog](https://www.cyberspec.dev/components.md)
- [Pagination source code](https://github.com/agnelnieves/cyberspec/blob/main/registry/cyber/ui/pagination.tsx)
- [Shadcn registry item](https://www.cyberspec.dev/r/pagination.json)
