Design system / Molecules
Molecule / Navigation
Pagination
Pagination arranges native page links with selected, previous, next and ellipsis treatments. The caller calculates destinations, page bounds and current selection. The component does not load results.
Live example
Current component with fictional data. Example changes are not persisted.
Responsibility
Page links complete one collection-navigation concern. Their shared styling comes from buttonVariants, but they remain anchors. A searchable or sortable collection coordinates additional concerns outside this family.
Public contract
The table describes supported inputs, exported parts and caller responsibilities. A callback supplies a command, such as saving a draft. These notes are maintained manually; check current source types before integration.
| Prop / part | Type | Requirement | Responsibility |
|---|---|---|---|
| isActive | boolean | PaginationLink · optional | Sets aria-current="page", data-active and outline rather than ghost styling. |
| size | Button size | PaginationLink · default icon | Style geometry only; the element is an anchor. |
| href / anchor props | React.ComponentProps<"a"> | Link props | Destinations and event policy supplied by the consumer. |
| className / children | Native element props | Optional | Assemble nav, list and items explicitly. |
API notes are curated documentation, not generated types. The source linked above is the current implementation; update these notes alongside API changes.
State and behavior
Identify which values the caller controls and which behavior the component or underlying primitive owns. A local example does not supply persistence, authorization or a complete product lifecycle.
No page, page count, fetching or URL hook is implemented. The consumer computes links and active state. PaginationPrevious/Next are styled anchors, not disabled-aware buttons.
Dependencies
- Native nav, ul, li and anchor elements
- buttonVariants()
- Lucide chevrons and MoreHorizontal
- cn()
Token and styling contract
These notes identify theme roles, utilities and direct style values used by the source. Direct colors or timings are implementation exceptions, not recommendations to bypass the theme.
outline / ghost buttonVariants- Selected and unselected link styles inherit Button variants.
gap-1 / size-9- List rhythm and ellipsis geometry.
Boundaries and limitations
- Ellipsis is hidden from accessibility; its nested screen-reader text is also within aria-hidden. It is not a load-more action.
Where to make a change
Change shared page-link anatomy in pagination.tsx or inherited buttonVariants. Change page bounds, destination generation and result fetching in the consuming list/controller; do not add transport to Pagination.
Selected real uses
No product consumer is recorded in this entry's selected-use notes. The implementation and specimen establish availability, not adoption. These notes are not an exhaustive usage scan.
These traces describe selected uses, not every dependency. Repository-only paths are shown as references; only approved files have public source views.
Usage contract
import { Pagination, PaginationContent, PaginationItem, PaginationLink } from "@/components/ui/pagination";
<Pagination><PaginationContent>
<PaginationItem><PaginationLink href="?page=1" isActive={page === 1}>1</PaginationLink></PaginationItem>
</PaginationContent></Pagination>Illustrative consumer bindings, not a self-contained product workflow. Live examples supply only local state or explicit fictional props.