Pagination

Navigazione tra pagine con pulsanti precedente e successivo, la pagina corrente evidenziata e puntini di sospensione per le pagine saltate: link componibili o un componente pronto all’uso guidato dal numero di pagine.

Disponibile in
  • Angular: disponibile
  • Vue: disponibile
  • React: disponibile
  • React Native: disponibile

Utilizzo

Showing page 5 of 12

Importazione

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

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

Selettore
sone-pagination
Input
NomeTipo Predefinito
pagebidirezionale

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`

SonePaginationContentDirectiveDirettiva

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

Selettore
ul[sonePaginationContent]

SonePaginationEllipsisComponentComponente

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

Selettore
sone-pagination-ellipsis
Input
NomeTipo Predefinito
srOnlyText

What screen readers hear in place of the hidden pages.

—$localize`More pages`

SonePaginationItemDirectiveDirettiva

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

Selettore
li[sonePaginationItem]

SonePaginationLinkDirectiveDirettiva

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

Selettore
a[sonePaginationLink], button[sonePaginationLink]
Input
NomeTipo Predefinito
isActive

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

booleanfalse
sizeButtonSize"icon"

SonePaginationNavDirectiveDirettiva

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

Selettore
nav[sonePaginationNav]
Input
NomeTipo Predefinito
aria-label—$localize`:Pagination navigation:Pagination`

SonePaginationNextComponentComponente

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

Selettore
a[sonePaginationNext], button[sonePaginationNext]
Input
NomeTipo Predefinito
label

The 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”.

Selettore
a[sonePaginationPrevious], button[sonePaginationPrevious]
Input
NomeTipo Predefinito
label

The visible text (projected content replaces it).

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