Pagination
Documentation and examples for showing pagination to indicate a series of related content exists across multiple pages.
This component is still under development. Please only use the snippets provided below to avoid breaking changes.
View the official docs here
Examples
Basic
The pagination component generates the pagination controls for the page.
You must set up the pagination through Astro’s paginate function (see below). This component then accesses the page
property to generate the pagination buttons.
The rendered code is a static example, click here to see a live demo.
The Pagination component returns the default bootstrap pagination component, with the current page as an active link, and prev/next disabled if not available e.g.
You can optionally set the aria-label
property with the ariaLabel
prop e.g.
<Pagination page={page} aria-label="Pagination">
Manual
API
Pagination
import { Pagination } from 'astro-bootstrap'
Name | Type | Default | Description |
---|---|---|---|
page required | Astro page property |
Gives Pagination access to the page
|
|
aria-label | Astro page property |
Page pagination control
|
Change the aria-label
|
class | string |
Appends a class to the pagination ul tag.
|
|
itemClass | string |
Appends a class to the page-item li tag.
|
|
linkClass | string |
Appends a class to the page-link anchor tag.
|
|
delta | number |
2
|
Number of pages to display either side of the current page in pagination widget. |