cv-pagination
Page navigation with bounded previous/next actions and current-page announcement.
Headless: createPagination
Usage
Anatomy
<cv-pagination> (host)
└── <nav part="nav" role="navigation" aria-label="Pagination">
└── <ol part="list">
├── <li part="item">
│ └── <button part="button previous-button">‹</button>
├── <li part="item">
│ └── <button part="button page-button" aria-current="page"?>1</button>
├── <li part="item">
│ └── <span part="ellipsis" aria-hidden="true">…</span>
└── <li part="item">
└── <button part="button next-button">›</button>Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
page | Number | 1 | Current page |
page-count | Number | 1 | Total pages |
sibling-count | Number | 1 | Adjacent visible pages |
boundary-count | Number | 1 | Start/end visible pages |
disabled | Boolean | false | Blocks navigation |
compact | Boolean | false | Compact rendering hint |
Events
| Event | Detail | Description |
|---|---|---|
cv-page-change | { page, previousPage } | Fires after user navigation changes the current page |
CSS Parts
| Part | Element | Description |
|---|---|---|
nav | <nav> | Navigation landmark wrapper |
list | <ol> | Ordered page item list |
item | <li> | List item wrapper |
button | <button> | Shared button part |
previous-button | <button> | Previous page button |
page-button | <button> | Numbered page button |
next-button | <button> | Next page button |
ellipsis | <span> | Non-interactive range gap |
CSS Custom Properties
| Property | Default | Description |
|---|---|---|
--cv-pagination-gap | var(--cv-space-1, 4px) | Gap between page controls |
--cv-pagination-button-size | 32px | Square button size |
--cv-pagination-border-color | var(--cv-color-border, #2a3245) | Button border color |
--cv-pagination-background | var(--cv-color-surface, #141923) | Button background |