Pagination
Navegação entre páginas com botões de anterior e seguinte, a página atual destacada e reticências para as páginas omitidas: links combináveis ou um componente pronto a usar controlado pelo número de páginas.
Angular: disponível Vue: disponível React: disponível React Native: disponível
Uso
Showing page 5 of 12
<div class="demo-stack">
<sone-pagination [(page)]="page" [total]="240" [pageSize]="20" />
<p class="text-hint" style="text-align: center">Showing page {{ page() }} of 12</p>
</div>Importação
import {
SonePaginationComponent,
SonePaginationContentDirective,
SonePaginationEllipsisComponent,
SonePaginationItemDirective,
SonePaginationLinkDirective,
SonePaginationNavDirective,
SonePaginationNextComponent,
SonePaginationPreviousComponent,
} from "@surface-one/angular/pagination";Referência da API
SonePaginationComponentComponente
`<sone-pagination>` — page buttons drawn from a page count: Previous, the first and last pages, `siblings` pages around the current one with ellipses for the gaps, and Next. Two-way `[(page)]` (1-based); the count is `pageCount`, or `total` items at `pageSize` a page.
| Nome | Tipo | Padrão |
|---|---|---|
pagebidirecionalThe current page, 1-based. | number | 1 |
totalHow many items there are; with `pageSize` it gives the page count. | number | 0 |
pageSize | number | 10 |
pageCountThe page count, when you know it (wins over `total` / `pageSize`). | number | null | null |
siblingsPages shown on each side of the current one. | number | 1 |
boundariesPages always shown at each end. | number | 1 |
disabled | boolean | false |
aria-label | — | $localize`:Pagination navigation:Pagination` |
previousLabel | — | $localize`:Previous page button:Previous` |
nextLabel | — | $localize`:Next page button:Next` |
SonePaginationContentDirectiveDiretiva
`ul[sonePaginationContent]` — the row of page links.
SonePaginationEllipsisComponentComponente
`<sone-pagination-ellipsis>` — stands in for hidden pages; says “More pages” to screen readers.
| Nome | Tipo | Padrão |
|---|---|---|
srOnlyTextWhat screen readers hear in place of the hidden pages. | — | $localize`More pages` |
SonePaginationItemDirectiveDiretiva
`li[sonePaginationItem]` — one link, previous / next or an ellipsis.
SonePaginationLinkDirectiveDiretiva
`a[sonePaginationLink]` / `button[sonePaginationLink]` — a page: a ghost icon button, outlined with `aria-current="page"` when `isActive`. Add `routerLink` or `href`.
| Nome | Tipo | Padrão |
|---|---|---|
isActiveThe current page: outlined, `aria-current="page"`. | boolean | false |
size | ButtonSize | "icon" |
SonePaginationNavDirectiveDiretiva
`nav[sonePaginationNav]` — the shadcn/ui Pagination root, for pages you lay out yourself (`<sone-pagination>` draws them from a page count). Named "Pagination" by default; set `aria-label` to name it otherwise.
| Nome | Tipo | Padrão |
|---|---|---|
aria-label | — | $localize`:Pagination navigation:Pagination` |
SonePaginationNextComponentComponente
`a[sonePaginationNext]` / `button[…]` — goes on a page: “Next” and a chevron.
| Nome | Tipo | Padrão |
|---|---|---|
labelThe visible text (projected content replaces it). | — | $localize`:Next page button:Next` |
aria-label | — | $localize`Go to next page` |
SonePaginationPreviousComponentComponente
`a[sonePaginationPrevious]` / `button[…]` — goes back a page: a chevron and “Previous”.
| Nome | Tipo | Padrão |
|---|---|---|
labelThe visible text (projected content replaces it). | — | $localize`:Previous page button:Previous` |
aria-label | — | $localize`Go to previous page` |