Pagination

前へ・次へボタン、現在のページの強調表示、省略されたページの省略記号を備えたページ送り。リンクを自由に組み合わせることも、ページ数で動く既製のコンポーネントを使うこともできます。

対応フレームワーク
  • Angular: 対応
  • Vue: 対応
  • React: 対応
  • React Native: 対応

使い方

Showing page 5 of 12

インポート

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

API リファレンス

SonePaginationComponentコンポーネント

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

セレクター
sone-pagination
入力
名前型 デフォルト
page双方向

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`

SonePaginationContentDirectiveディレクティブ

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

セレクター
ul[sonePaginationContent]

SonePaginationEllipsisComponentコンポーネント

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

セレクター
sone-pagination-ellipsis
入力
名前型 デフォルト
srOnlyText

What screen readers hear in place of the hidden pages.

—$localize`More pages`

SonePaginationItemDirectiveディレクティブ

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

セレクター
li[sonePaginationItem]

SonePaginationLinkDirectiveディレクティブ

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

セレクター
a[sonePaginationLink], button[sonePaginationLink]
入力
名前型 デフォルト
isActive

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

booleanfalse
sizeButtonSize"icon"

SonePaginationNavDirectiveディレクティブ

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

セレクター
nav[sonePaginationNav]
入力
名前型 デフォルト
aria-label—$localize`:Pagination navigation:Pagination`

SonePaginationNextComponentコンポーネント

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

セレクター
a[sonePaginationNext], button[sonePaginationNext]
入力
名前型 デフォルト
label

The visible text (projected content replaces it).

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

SonePaginationPreviousComponentコンポーネント

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

セレクター
a[sonePaginationPrevious], button[sonePaginationPrevious]
入力
名前型 デフォルト
label

The visible text (projected content replaces it).

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