Component
Pagination
A small pagination primitive for tables, ledgers, and search results.
Preview
Installation
Install the package, then import the component and shared stylesheet in your app.
Package install
Install the package when you want components imported from axie-ui.
install
pnpm add axie-uiImport
code
import "axie-ui/styles.css";import { Pagination } from "axie-ui";Registry install
Use the direct URL when you want shadcn to copy editable source into your app. This works without the official registry and does not install axie-ui.
registry
pnpm dlx shadcn@latest add https://axie.alexi.life/r/pagination.jsonCopied source import
code
import "@/styles/axie.css";import { Pagination } from "@/components/axie/pagination";Prefer @axie/pagination? Add the Axie namespace once from the Installation page, then use that shorthand.
Usage
code
import { Pagination, PaginationItem } from "axie-ui";export function Example() { return ( <Pagination> <PaginationItem>Prev</PaginationItem> <PaginationItem current>2</PaginationItem> <PaginationItem>Next</PaginationItem> </Pagination> );}Accessibility
- Use links when pages are navigable URLs and buttons when pagination is local state.
- Mark the current page with `aria-current="page"`.
- Keep previous and next labels available to assistive technology.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | Pagination | Accessible nav label. |
| current | boolean | - | Marks the active page. |
| ...props | ButtonHTMLAttributes<HTMLButtonElement> | - | Native button props. |