Pagination
A pagination nav with Prev and Next buttons that disable at the edges and numbered page buttons that mark the current page with aria-current. Built in React.
src/registry/ui/pagination.tsx/r/pagination.json
Installation#
bash
npx shadcn@latest add @minidev/pagination
MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/pagination.json
Usage#
tsx
import { Pagination } from "@/components/ui/pagination"
export function Example() {
return (
<Pagination page={page} pageCount={5} onPageChange={setPage} />
)
}
API reference#
| Prop | Type | Default |
|---|---|---|
page* | number | - |
pageCount* | number | - |
onPageChange* | (p: number) => void | - |
className | string | - |
* required
Dependencies#
npm
React only
Built from
Examples#
Related navigation components#
Back LinkSmall back navigation link with a left arrow icon, muted text that darkens on hover and a visible focus ring. Defaults to the label Back and accepts any href.Breadcrumb EllipsisEllipsis marker for collapsing the middle of long breadcrumb trails. Decorative and hidden from assistive tech, sized to sit between breadcrumb separators.BreadcrumbBreadcrumb navigation from an items array, with chevron separators, linked ancestors and the current page marked with aria-current. Built with React.Collapsible SidebarSidebar with a toggle button on its edge that collapses it to a narrow rail and expands it again. The button label updates for screen readers.Command ItemRow for command menus with a label, an optional keyboard shortcut in a kbd tag and an active highlight state. Use it to build custom command lists.Command PaletteCmd K style command palette in a dialog with a search field that filters commands as you type, runs the chosen action and closes. Shows an empty state.
All navigation components