# Pagination

> Infinite scroll, load-more, and numbered-page primitives for paginated galleries.

Source: https://gallerykit.n.yatsyk.com/docs/pagination

# @gallerykit/pagination

**@gallerykit/pagination** ships three drop-in pagination components: `<InfiniteScroll>`, `<LoadMoreButton>`, and `<PageButtons>`. They emit the same callback shape, so swapping between modes is a one-line change.

* **Stability:** experimental
* **Peer dependencies:** `react`, `react-dom`
* **Dependencies:** `@gallerykit/core`

## Install

```bash
pnpm add @gallerykit/pagination
```

## Quick example

```tsx
import { InfiniteScroll, LoadMoreButton } from "@gallerykit/pagination";

<InfiniteScroll hasMore={page < total} onLoadMore={() => setPage((p) => p + 1)} />
```

See [Getting Started](./getting-started.mdx) for the full walkthrough and [API](./api.mdx) for the public exports.
