Pagination

Nawigacja po stronach z przyciskami Wstecz i Dalej, oznaczoną bieżącą stroną i wielokropkami w miejscu pominiętych stron — składane linki albo gotowy komponent sterowany liczbą stron.

Dostępny w
  • Angular: dostępny
  • Vue: dostępny
  • React: dostępny
  • React Native: dostępny

Użycie

Showing page 5 of 12

Import

ts
import {
  SonePaginationComponent,
  SonePaginationContentDirective,
  SonePaginationEllipsisComponent,
  SonePaginationItemDirective,
  SonePaginationLinkDirective,
  SonePaginationNavDirective,
  SonePaginationNextComponent,
  SonePaginationPreviousComponent,
} from "@surface-one/angular/pagination";

Dokumentacja API

SonePaginationComponentKomponent

`<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.

Selektor
sone-pagination
Wejścia
NazwaTyp Domyślnie
pagedwukierunkowe

The current page, 1-based.

number1
total

How many items there are; with `pageSize` it gives the page count.

number0
pageSizenumber10
pageCount

The page count, when you know it (wins over `total` / `pageSize`).

number | nullnull
siblings

Pages shown on each side of the current one.

number1
boundaries

Pages always shown at each end.

number1
disabledbooleanfalse
aria-label—$localize`:Pagination navigation:Pagination`
previousLabel—$localize`:Previous page button:Previous`
nextLabel—$localize`:Next page button:Next`

SonePaginationContentDirectiveDyrektywa

`ul[sonePaginationContent]` — the row of page links.

Selektor
ul[sonePaginationContent]

SonePaginationEllipsisComponentKomponent

`<sone-pagination-ellipsis>` — stands in for hidden pages; says “More pages” to screen readers.

Selektor
sone-pagination-ellipsis
Wejścia
NazwaTyp Domyślnie
srOnlyText

What screen readers hear in place of the hidden pages.

—$localize`More pages`

SonePaginationItemDirectiveDyrektywa

`li[sonePaginationItem]` — one link, previous / next or an ellipsis.

Selektor
li[sonePaginationItem]

SonePaginationLinkDirectiveDyrektywa

`a[sonePaginationLink]` / `button[sonePaginationLink]` — a page: a ghost icon button, outlined with `aria-current="page"` when `isActive`. Add `routerLink` or `href`.

Selektor
a[sonePaginationLink], button[sonePaginationLink]
Wejścia
NazwaTyp Domyślnie
isActive

The current page: outlined, `aria-current="page"`.

booleanfalse
sizeButtonSize"icon"

SonePaginationNavDirectiveDyrektywa

`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.

Selektor
nav[sonePaginationNav]
Wejścia
NazwaTyp Domyślnie
aria-label—$localize`:Pagination navigation:Pagination`

SonePaginationNextComponentKomponent

`a[sonePaginationNext]` / `button[…]` — goes on a page: “Next” and a chevron.

Selektor
a[sonePaginationNext], button[sonePaginationNext]
Wejścia
NazwaTyp Domyślnie
label

The visible text (projected content replaces it).

—$localize`:Next page button:Next`
aria-label—$localize`Go to next page`

SonePaginationPreviousComponentKomponent

`a[sonePaginationPrevious]` / `button[…]` — goes back a page: a chevron and “Previous”.

Selektor
a[sonePaginationPrevious], button[sonePaginationPrevious]
Wejścia
NazwaTyp Domyślnie
label

The visible text (projected content replaces it).

—$localize`:Previous page button:Previous`
aria-label—$localize`Go to previous page`