Directory
- Welcome
Pagination Component
The Pagination component provides an intuitive interface for navigating through multi-page content. It features two variants, accessible controls, and customizable styling options. It is built to use the Astro collections pagination data but can be passed custom pagination data.
Key Features
-
Two Variants: Standard and minimal pagination styles
-
Dynamic Page Numbers: Intelligent page number display
-
Accessible Controls: Built with ARIA support
-
Responsive Design: Adapts to different screen sizes
Basic Usage
Create a standard pagination control:
<Pagination data={paginationData} maxPagesDisplayed={5} />
Variants
Standard Pagination
The standard pagination includes numbered pages and navigation buttons:
<Pagination data={{ currentPage: 3, lastPage: 10, url: { prev: '#', current: '#', next: '#' } }} maxPagesDisplayed={5}/>
Minimal Pagination
A simplified version with only previous/next navigation:
<PaginationMinimal prevUrl="#" currentUrl="#" nextUrl="#" />
Pagination Props API
Standard Pagination
Prop | Type | Default | Description |
---|---|---|---|
data | Page | Pagination data object containing current page, last page, and URLs | |
maxPagesDisplayed | number | 5 | Maximum number of page buttons to display |
Minimal Pagination
Prop | Type | Default | Description |
---|---|---|---|
prevUrl | string | URL for the previous page | |
nextUrl | string | URL for the next page |
Common Use Cases
Limited Time Launch Sale
Add professional pagination to your website with our AstroJS starter template. Get started now!
GET 60% OFF!