Skip to content

Pagination

The Pagination component provides a set of controls that allow users to navigate between pages of content, typically used for lists, search results, or articles.

Add the Pagination component and its sub-components to your project using the OrbitUI CLI:

Terminal window
npx orbitkit@latest add pagination

Import the Pagination component along with its sub-components: PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, and PaginationEllipsis.

Structure your pagination controls by wrapping them in PaginationContent within the main Pagination component. Each navigation element should be enclosed in a PaginationItem. Use PaginationLink for page numbers, PaginationPrevious and PaginationNext for navigation buttons, and PaginationEllipsis to indicate skipped page ranges.

The Pagination system consists of several components, each with its own set of props:

The Pagination component serves as the main wrapper for the entire pagination system. It semantically represents a navigation section. This component accepts all the standard HTML attributes that a <nav> element would.

The PaginationContent component acts as the container for all pagination items. This component accepts all the standard HTML attributes that a <ul> (unordered list) element would.

The PaginationItem component is a wrapper for individual pagination elements. Each link, button, or ellipsis should be enclosed within a PaginationItem. This component accepts all the standard HTML attributes that an <li> (list item) element would.

The PaginationLink component represents a clickable link to a specific page number. This component accepts all the standard HTML attributes that an <a> element would. Plus the following props:

PropTypeDefault
isActivebooleanfalse

The PaginationPrevious component represents a button or link to navigate to the previous page. This component accepts all the standard HTML attributes that an <a> element would.

The PaginationNext component represents a button or link to navigate to the next page. This component accepts all the standard HTML attributes that an <a> element would.

The PaginationEllipsis component is used to indicate a skipped range of pages. This component accepts all the standard HTML attributes that a <span> element would.