Pagination
The Pagination component provides a reusable pattern for pagination in the interface.
Pagination
Basic pagination with 15 pages, demonstrating overflow ellipsis indicators when the list exceeds five visible items.
Using JS
With just a few added attributes you can have pagination made for you, including keepDOM, pagesToShow, and randomizeOrder options.
Simple pagination
Showing all pages in the pagination at the same time.
Async rendered pagination items
Items are injected into the pagination container after initialization using script.
Pagination with pagesToShow attribute.
Takes an even number (or closest even number) and only show that amount of pages (in addition to the current page).
Pagination with pagesToShow attribute.
Takes an even number (or closest even number) and only show that amount of pages (in addition to the current page).
Small list
Pagination with four pages and a static active page — no overflow or ellipsis indicators are shown when the total fits within the visible window.
Button size: medium
Pagination rendered with medium-sized buttons using buttonSize 'md', producing wider page-number buttons than the default small size.
Button size: large
Pagination rendered with large-sized buttons using buttonSize 'lg', producing the widest page-number buttons in the available size scale.
Button style: outlined
Pagination using outlined button style, giving page buttons a bordered appearance instead of the default filled background.
Button style: basic
Pagination using basic button style, rendering page buttons without fill or border for a minimal, text-only appearance.
API
| Parameter | Default | Type | Description |
|---|---|---|---|
|
list
|
[] | array | - |
|
current
|
1 | integer | - |
|
currentClass
|
--is-active | string | - |
|
componentElement
|
nav | string | - |
|
listElement
|
ul | string | - |
|
listItem
|
li | string | - |
|
linkPrefix
|
?pagination= | string | - |
|
anchorTag
|
string | - | |
|
previousDisabled
|
false | string | - |
|
nextDisabled
|
false | string | - |
|
useJS
|
false | boolean | - |
|
randomizeOrder
|
false | boolean | - |
|
perPage
|
10 | integer | - |
|
maxPages
|
false | boolean | - |
|
buttonStyle
|
filled | string | - |
|
buttonSize
|
sm | string | - |
|
pagesToShow
|
false | boolean | - |
|
keepDOM
|
false | boolean | - |
|
async
|
false | boolean | - |
CSS API
| Variable | Default | Type | Values | Description |
|---|---|---|---|---|
|
--c-pagination--base
|
var(--base) | range | - | Main unit that drives radius and spacing scales. |
|
--c-pagination--space
|
var(--space) | range | - | Base spacing unit. Used for padding and margin inside components. |