Pagination moves through a long list one page at a time: literal "Previous" and "Next" keys around 40 px page squares in tabular figures (the first and last page, one sibling each side of the current one, gaps as "…"). The current page prints on the selected face. Below the sm container width the squares give way to "Page 2 of 7". Every link comes from href(page), so it works without JavaScript.
Example#
Usage#
Use pagination to move through a long list one page at a time: the journal, a gallery of work. Every page is a real link from href(page), so it works without JavaScript and each page can be shared.
- Shape. Literal "Previous" and "Next" keys around page squares: the first and the last page, one on each side of the current one, and "…" for gaps.
- Phones. Below the sm width the squares give way to "Page 2 of 7".
- Short lists need no pagination; a list people want to see whole is better on one page.
Anatomy#
- Previous
data-mk-part="previous" - Pages
data-mk-part="pages" - Current pageOn the selected face, with aria-current.
.mk-pagination-page[aria-current="page"] - Next
data-mk-part="next"
Volume#
Reading layer: identical at every volume.
Quiet
Studio
Press
Rave
Content#
- The keys say "Previous" and "Next"; no arrows alone, no "Older" and "Newer" that depend on sort order.
Do and don't#
Do
Don't
« ‹ 1 2 3 4 5 6 7 › »
Accessibility#
- A
navnamed "Pagination"; the current page carriesaria-current="page"and every page link is named "Page n". - At the first or last page the key it cannot follow stays in place, disabled, so the layout never jumps.
- Page squares grow to 44 px under a coarse pointer.
| Keys | What happens |
|---|---|
| Tab | Moves through Previous, the page links and Next |
| Enter | Follows the focused link |
The colour pairs it prints, with their contrast on both papers:
| Text | Surface | Role | Bone | Night |
|---|---|---|---|---|
--mk-text | --mk-surface | ui | not in this look | not in this look |
--mk-on-selected | --mk-selected | ui | not in this look | not in this look |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
page required | number | none | The current page, from 1. |
pageCount required | number | none | |
href required | (page: number) => string | none | The URL of a page. |
copy | Partial<PaginationCopy> | none |
Tokens#
System tokens (18)
--mk-border--mk-control-rule--mk-dur-hover--mk-ease-out--mk-focus--mk-font-text--mk-hover--mk-on-selected--mk-radius-control--mk-selected--mk-space-2--mk-space-3--mk-surface--mk-text--mk-type-body-ui-leading--mk-type-body-ui-size--mk-type-control-sm-size--mk-type-control-sm-weight
Its own properties (2)
--mk-pagination-leading--mk-pagination-square
Changelog#
Arrived in 0.9.0.
Breadcrumbs,Pagination(withpaginationRange),Count,ProgressBar(bar, segments, indeterminate),AvatarandAvatarGroup,Tick,EmptyState,Kbd,SkeletonandLoader. Read the whole entry