# Pagination

Page navigation with prev/next and jump



<ComponentPreview base="ink" name="pagination-demo" />

Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @termcn/pagination
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource base="ink" name="pagination" title="components/ui/pagination.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

Usage [#usage]

```tsx
import { Pagination } from "@/components/ui/pagination";
```

```tsx
<Pagination total={10} current={page} onChange={(p) => setPage(p)} />
```

API Reference [#api-reference]

Pagination [#pagination]

| Prop        | Type                     | Default    |
| ----------- | ------------------------ | ---------- |
| `total`     | `number`                 | `required` |
| `current`   | `number`                 | `required` |
| `onChange`  | `(page: number) => void` | -          |
| `showEdges` | `boolean`                | `true`     |
| `siblings`  | `number`                 | `1`        |
