Navigation
Glass Pagination
Page numbers with previous and next, condensing long ranges so the row stays short.
Preview
Installation
Install the package once, then import the parts you use into a standalone component.
Install
npm install ngx-vitreo @angular/cdk @floating-ui/domImport
import { GlassPagination } from 'ngx-vitreo';
@Component({
imports: [GlassPagination],
// ...
})Usage
Usage
<glass-panel class="cpreview-bar" variant="pill">
<nav glassPagination [page]="page()" (pageChange)="go($event)" [pageCount]="12" [siblingCount]="0"></nav>
</glass-panel>API reference
GlassPagination
nav[glassPagination], glass-pagination
| Input | Type | Default | Description |
|---|---|---|---|
[(page)] | number | None | The current page, counting from 1. Values outside 1 to pageCount are clamped. Required. |
(pageChange) | number | None | Emits the page to show. |
pageCount | number | None | How many pages there are. Required. |
siblingCount | number | 1 | Pages shown on each side of the current page. |
boundaryCount | number | 1 | Pages always shown at each end. |
previousLabel | string | 'Previous page' | Accessible name of the previous button. |
nextLabel | string | 'Next page' | Accessible name of the next button. |