Skip to Content
ComponentsPagination

Pagination

The Pagination component provides you with page navigation and pagination.

Live Examples

Live Example
☀️
Copy
View Code
import { Pagination } from '@jarllyng/nostromo' export default function PaginationExample() { const [currentPage, setCurrentPage] = React.useState(1) return ( <Pagination currentPage={currentPage} totalPages={10} onPageChange={setCurrentPage}...

Import

import { Pagination } from "@jarllyng/nostromo"; // or import { Pagination } from "@jarllyng/nostromo/pagination";

Usage

import { Pagination } from "@jarllyng/nostromo"; export default function Example() { const [currentPage, setCurrentPage] = React.useState(1); return ( <Pagination currentPage={currentPage} totalPages={10} onPageChange={setCurrentPage} /> ); }

Props

PropTypeDefaultRequiredDescription
currentPagenumber-YesCurrent active page (1-indexed)
totalPagesnumber-YesTotal number of pages
onPageChange(page: number) => void-YesCallback when page changes
showFirstLastbooleantrueNoWhether to show first/last page buttons
showPrevNextbooleantrueNoWhether to show previous/next buttons
maxVisiblePagesnumber5NoMaximum number of visible page buttons
disabledbooleanfalseNoWhether pagination is disabled
variant"default" | "outline" | "ghost""default"NoVisual variant
size"sm" | "default" | "lg""default"NoSize of pagination buttons
classNamestringundefinedNoAdditional CSS classes

Standard HTML Props

The Pagination component extends React.HTMLAttributes<HTMLElement>, so it accepts all standard HTML attributes (e.g., id, data-*, aria-*).

Last updated on