27.0.0-preview.2 (most recent)27.0.0-preview.1BlazorReactWeb

Paginator

A paginator steps through data shown in pages and tells readers where they are in the set. It holds only the numbers and fires an event on each move, so your page decides which rows to show. The paginators below are live, so press the arrows and watch the position change.

Reference docs⁠

OverviewExamplesAPIAccessibility

Built in⁠

  • It works out the page count from item-count and items-per-page, and shows the range on screen, such as 1-10 of 100.
  • items-per-page-selection adds a page size select and sets the starting page size.
  • Its text is in the application's language. positionFormatter and itemsPerPageFormatter reword the range text and the page size options.
  • First, previous, next, and last buttons step through the pages, and each press fires an event.

Using paginators well⁠

  • Put the paginator at the end of the table or list it pages, aligned to the trailing edge.
  • Set no-border when the paginator sits inside a table that already draws a border.
  • Set items-per-page for the page size you want, or give items-per-page-selection and let its first value apply.
  • Slice or fetch the rows in your own listener, and read page-number from the paginator when the page size changes.
  • Keep the default range text, in the form first-last of total, and replace it with positionFormatter only to translate it.

These rules follow Material 3 Expressive's guidance for data tables, on material.io.

Position and pages⁠

item-count is the total number of items, and items-per-page is how many one page shows. The paginator works out the page count from the two and shows the range, such as 21-30 of 100.

page-number starts at 0, so page-number="2" is the third page. The range text and the live region count from 1. Setting it beyond the last page moves it back to the last one, and fires no event.

Keep your own page state from 0 as well: start it at 0 for the first page, store the event's pageNumber as it comes, and add 1 only where you show it, as in "Page 1 of 9". Work out the page count as Math.ceil(itemCount / itemsPerPage) in script, or (int)Math.Ceiling(itemCount / (double)itemsPerPage) in C#.

The paginator holds only numbers and never touches your rows. In the page-number-change listener, take the rows that start at pageNumber * itemsPerPage: rows.slice(start, start + itemsPerPage) in script, or rows.Skip(start).Take(itemsPerPage) in C#.

In Blazor, the handler takes PageNumberChangeEventArgs and reads args.PageNumber directly: Blazor event arguments have no Detail. Name the field that holds the page pageNumber or currentPage, never page. Razor reads PageNumber="@page" as the start of a page directive, such as @page "/orders", and the component does not compile.

items-per-page defaults to 12, so a paginator with only item-count set reads 1-12 of the total. Set it for any other page size.

Page size⁠

items-per-page-selection takes an array of numbers and adds a select for them. Set it from script, since an array is not a plain attribute. With one number the select is hidden, and with none there is no select. The page size starts at items-per-page when the list offers it, and at the list's first number when it does not.

Changing the size keeps the reader near the same items and fires items-per-page-change, whose detail carries itemsPerPage. The paginator moves to the page that holds the first item shown before, Math.floor(pageNumber * oldSize / newSize), and fires no page-number-change for it. So in that listener, store the new size and read page-number from the paginator, or work it out the same way. In Blazor, the handler reads args.ItemsPerPage and works out the page, since the component does not report it.

positionFormatter, itemsPerPageFormatter and pageStatusFormatter reword the range text, each option's text and the "Page N of M" announcement. Each is a function that returns a promise of the text, so a formatter can fetch a translation, and the default text shows until the promise resolves. The position formatter gets the first item, the last item and the total, counted from 1; the status formatter gets the page, counted from 1, and the page count. In Blazor they are Func<int, int, int, Task<string>>, Func<int, Task<string>> and Func<int, int, Task<string>>. The preview cannot pass a function, so set them from script.

Moving by code⁠

firstPage, previousPage, nextPage, and lastPage do what the four buttons do. Each fires page-number-change with the new pageNumber when the page changes, and does nothing at an end or while the paginator is disabled.

Setting page-number moves the paginator without an event. Listen for the event to learn what the reader did, and set the property to move the paginator. The demo sets page-number from a variable, so its buttons move the paginator to the first, fifth and last of nine pages, and the arrows report their change in the line below.

In your own page, store the event's pageNumber in that variable too, so the variable and the paginator agree. In Blazor, the methods are FirstPageAsync, PreviousPageAsync, NextPageAsync and LastPageAsync: give the paginator @ref="pager", declare private CbPaginator pager = default!;, and call await pager.NextPageAsync().

Labels⁠

Every name the paginator shows or announces is in the application's language by default. Set a label to word one differently: controls-label names the group of controls, first-page-label, previous-page-label, next-page-label and last-page-label name the four buttons, and items-per-page-label names the page size select. Name the paginator's landmark with aria-label. The range text and the page size options take a formatter instead, as Page size shows.

Disabled⁠

disabled disables all four buttons and the page size select together. There is no softer state: the controls leave the Tab order while it is set. Use it while the page fetches the next rows.

In a bordered table⁠

The paginator draws a border along its top edge. Set no-border to remove it where the table supplies its own. The paginator is 48 pixels tall and aligns to the trailing edge of its container.

Properties⁠

PropertyAttributeTypeDescription
controlsLabelcontrols-labelstringOverrides the accessible name of the group holding the controls ("Pagination controls" in English). Unset or empty, the name is in the application's language. See Labels.
disableddisabledbooleandefault falseWhether the paginator controls are disabled. When disabled, the navigation buttons and select are non-interactive, and firstPage(), previousPage(), nextPage() and lastPage() do nothing. See Disabled.
firstPageLabelfirst-page-labelstringOverrides the accessible name of the First page button. Unset or empty, the name is in the application's language. See Labels.
itemCountitem-countnumberdefault 0Total number of items being paginated. Used to calculate the number of pages and position display. See Position and pages.
itemsPerPageitems-per-pagenumberdefault 12The number of items on a page. When items-per-page-selection is set and does not offer this number, the paginator takes that list's first value. See Position and pages, Page size.
itemsPerPageFormatter(itemsPerPage: number) => Promise<string>Custom formatter for the items-per-page display text. Receives the current items per page value, returns a promise of the display string. The text shows its default (or the last formatted text) until the promise resolves; a result for a replaced formatter is ignored. The default text is already in the application's language; use this to word it differently (e.g., async (n) => n + " rows"). See Page size.
itemsPerPageLabelitems-per-page-labelstringOverrides the accessible name of the items-per-page select ("Items per page" in English). Unset or empty, the name is in the application's language. See Labels.
itemsPerPageSelectionitems-per-page-selectionnumber[]default []Available options for items per page in the dropdown. Example: [10, 25, 50, 100]. The select dropdown is hidden if only one option. See Page size.
lastPageLabellast-page-labelstringOverrides the accessible name of the Last page button. Unset or empty, the name is in the application's language. See Labels.
nextPageLabelnext-page-labelstringOverrides the accessible name of the Next page button. Unset or empty, the name is in the application's language. See Labels.
noBorderno-borderbooleandefault falseHides the top border. Set to true when used inside a data table that already has borders. See In a bordered table.
pageNumberpage-numbernumberdefault 0The current page, counted from 0. Set it to change page from code. Setting it fires no event, and a value out of range is clamped to the first or last page. See Position and pages, Page size, Moving by code.
pageStatusFormatter(page: number, total: number) => Promise<string>Custom formatter for the text announced to screen readers when the page changes ("Page 2 of 5" in English). Receives the current page, counted from 1, and the page count, returns a promise of the text. The default text is announced until the promise resolves; a result for a replaced formatter is ignored. See Page size.
positionFormatter(first: number, last: number, total: number) => Promise<string>Custom formatter for the position display text. Receives first item index, last item index, and total count, returns a promise of the display string. The text shows its default (or the last formatted text) until the promise resolves; a result for a replaced formatter is ignored. The default text is already in the application's language; use this to word it differently (e.g., async (f, l, t) => "Showing " + f + " to " + l). See Page size.
previousPageLabelprevious-page-labelstringOverrides the accessible name of the Previous page button. Unset or empty, the name is in the application's language. See Labels.

Events⁠

EventTypeDetailDescription
page-number-changePageNumberChangeEventPageNumberChangeEventDetailWhen the page changes through a button or a page method. It bubbles and is composed.
items-per-page-changeItemsPerPageChangeEventItemsPerPageChangeEventDetailWhen the user chooses a different items-per-page value. The page number is recomputed without a page-number-change event. It bubbles and is composed.

Methods⁠

MethodReturnsDescription
firstPage()voidGoes to the first page, firing page-number-change if the page changes. Does nothing while disabled is set.
lastPage()voidGoes to the last page, firing page-number-change if the page changes. Does nothing while disabled is set.
nextPage()voidGoes to the next page, firing page-number-change if the page changes. Does nothing while disabled is set.
previousPage()voidGoes to the previous page, firing page-number-change if the page changes. Does nothing while disabled is set.

Props⁠

PropTypeDescription
controlsLabelstringOverrides the accessible name of the group holding the controls ("Pagination controls" in English). Unset or empty, the name is in the application's language. See Labels.
disabledbooleandefault falseWhether the paginator controls are disabled. When disabled, the navigation buttons and select are non-interactive, and firstPage(), previousPage(), nextPage() and lastPage() do nothing. See Disabled.
firstPageLabelstringOverrides the accessible name of the First page button. Unset or empty, the name is in the application's language. See Labels.
itemCountnumberdefault 0Total number of items being paginated. Used to calculate the number of pages and position display. See Position and pages.
itemsPerPagenumberdefault 12The number of items on a page. When itemsPerPageSelection is set and does not offer this number, the paginator takes that list's first value. See Position and pages, Page size.
itemsPerPageFormatter(itemsPerPage: number) => Promise<string>Custom formatter for the items-per-page display text. Receives the current items per page value, returns a promise of the display string. The text shows its default (or the last formatted text) until the promise resolves; a result for a replaced formatter is ignored. The default text is already in the application's language; use this to word it differently (e.g., async (n) => n + " rows"). See Page size.
itemsPerPageLabelstringOverrides the accessible name of the items-per-page select ("Items per page" in English). Unset or empty, the name is in the application's language. See Labels.
itemsPerPageSelectionnumber[]default []Available options for items per page in the dropdown. Example: [10, 25, 50, 100]. The select dropdown is hidden if only one option. See Page size.
lastPageLabelstringOverrides the accessible name of the Last page button. Unset or empty, the name is in the application's language. See Labels.
nextPageLabelstringOverrides the accessible name of the Next page button. Unset or empty, the name is in the application's language. See Labels.
noBorderbooleandefault falseHides the top border. Set to true when used inside a data table that already has borders. See In a bordered table.
pageNumbernumberdefault 0The current page, counted from 0. Set it to change page from code. Setting it fires no event, and a value out of range is clamped to the first or last page. See Position and pages, Page size, Moving by code.
pageStatusFormatter(page: number, total: number) => Promise<string>Custom formatter for the text announced to screen readers when the page changes ("Page 2 of 5" in English). Receives the current page, counted from 1, and the page count, returns a promise of the text. The default text is announced until the promise resolves; a result for a replaced formatter is ignored. See Page size.
positionFormatter(first: number, last: number, total: number) => Promise<string>Custom formatter for the position display text. Receives first item index, last item index, and total count, returns a promise of the display string. The text shows its default (or the last formatted text) until the promise resolves; a result for a replaced formatter is ignored. The default text is already in the application's language; use this to word it differently (e.g., async (f, l, t) => "Showing " + f + " to " + l). See Page size.
previousPageLabelstringOverrides the accessible name of the Previous page button. Unset or empty, the name is in the application's language. See Labels.

Events⁠

PropArgumentDescription
onPageNumberChangePageNumberChangeEventWhen the page changes through a button or a page method. It bubbles and is composed. Its detail carries pageNumber.
onItemsPerPageChangeItemsPerPageChangeEventWhen the user chooses a different items-per-page value. The page number is recomputed without a page-number-change event. It bubbles and is composed. Its detail carries itemsPerPage.

Methods⁠

Call these on the element the ref holds.

MethodReturnsDescription
firstPage()voidGoes to the first page, firing page-number-change if the page changes. Does nothing while disabled is set.
lastPage()voidGoes to the last page, firing page-number-change if the page changes. Does nothing while disabled is set.
nextPage()voidGoes to the next page, firing page-number-change if the page changes. Does nothing while disabled is set.
previousPage()voidGoes to the previous page, firing page-number-change if the page changes. Does nothing while disabled is set.

Parameters⁠

ParameterTypeDescription
ControlsLabelstring?Overrides the accessible name of the group holding the controls ("Pagination controls" in English). Unset or empty, the name is in the application's language. See Labels.
Disabledbool?default falseWhether the paginator controls are disabled. When disabled, the navigation buttons and select are non-interactive, and firstPage(), previousPage(), nextPage() and lastPage() do nothing. See Disabled.
FirstPageLabelstring?Overrides the accessible name of the First page button. Unset or empty, the name is in the application's language. See Labels.
ItemCountint?default 0Total number of items being paginated. Used to calculate the number of pages and position display. See Position and pages.
ItemsPerPageint?default 12The number of items on a page. When ItemsPerPageSelection is set and does not offer this number, the paginator takes that list's first value. See Position and pages, Page size.
ItemsPerPageFormatterinteractive rendering onlyFunc<int, Task<string>>?Custom formatter for the items-per-page display text. Receives the current items per page value, returns a promise of the display string. The text shows its default (or the last formatted text) until the promise resolves; a result for a replaced formatter is ignored. The default text is already in the application's language; use this to word it differently (e.g., async (n) => n + " rows"). See Page size.
ItemsPerPageLabelstring?Overrides the accessible name of the items-per-page select ("Items per page" in English). Unset or empty, the name is in the application's language. See Labels.
ItemsPerPageSelectionIEnumerable<int>?default []Available options for items per page in the dropdown. Example: [10, 25, 50, 100]. The select dropdown is hidden if only one option. See Page size.
LastPageLabelstring?Overrides the accessible name of the Last page button. Unset or empty, the name is in the application's language. See Labels.
NextPageLabelstring?Overrides the accessible name of the Next page button. Unset or empty, the name is in the application's language. See Labels.
NoBorderbool?default falseHides the top border. Set to true when used inside a data table that already has borders. See In a bordered table.
PageNumberint?default 0The current page, counted from 0. Set it to change page from code. Setting it fires no event, and a value out of range is clamped to the first or last page. See Position and pages, Page size, Moving by code.
PageStatusFormatterinteractive rendering onlyFunc<int, int, Task<string>>?Custom formatter for the text announced to screen readers when the page changes ("Page 2 of 5" in English). Receives the current page, counted from 1, and the page count, returns a promise of the text. The default text is announced until the promise resolves; a result for a replaced formatter is ignored. See Page size.
PositionFormatterinteractive rendering onlyFunc<int, int, int, Task<string>>?Custom formatter for the position display text. Receives first item index, last item index, and total count, returns a promise of the display string. The text shows its default (or the last formatted text) until the promise resolves; a result for a replaced formatter is ignored. The default text is already in the application's language; use this to word it differently (e.g., async (f, l, t) => "Showing " + f + " to " + l). See Page size.
PreviousPageLabelstring?Overrides the accessible name of the Previous page button. Unset or empty, the name is in the application's language. See Labels.

Event callbacks⁠

ParameterTypeDescription
OnPageNumberChangeEventCallback<PageNumberChangeEventArgs>When the page changes through a button or a page method. It bubbles and is composed. The handler's argument has PageNumber: read args.PageNumber; there is no Detail.
OnItemsPerPageChangeEventCallback<ItemsPerPageChangeEventArgs>When the user chooses a different items-per-page value. The page number is recomputed without a page-number-change event. It bubbles and is composed. The handler's argument has ItemsPerPage: read args.ItemsPerPage; there is no Detail.

Inputs⁠

InputTypeDescription
controlsLabelstringOverrides the accessible name of the group holding the controls ("Pagination controls" in English). Unset or empty, the name is in the application's language. See Labels.
disabledbooleandefault falseWhether the paginator controls are disabled. When disabled, the navigation buttons and select are non-interactive, and firstPage(), previousPage(), nextPage() and lastPage() do nothing. See Disabled.
firstPageLabelstringOverrides the accessible name of the First page button. Unset or empty, the name is in the application's language. See Labels.
itemCountnumberdefault 0Total number of items being paginated. Used to calculate the number of pages and position display. See Position and pages.
itemsPerPagenumberdefault 12The number of items on a page. When itemsPerPageSelection is set and does not offer this number, the paginator takes that list's first value. See Position and pages, Page size.
itemsPerPageFormatter(itemsPerPage: number) => Promise<string>Custom formatter for the items-per-page display text. Receives the current items per page value, returns a promise of the display string. The text shows its default (or the last formatted text) until the promise resolves; a result for a replaced formatter is ignored. The default text is already in the application's language; use this to word it differently (e.g., async (n) => n + " rows"). See Page size.
itemsPerPageLabelstringOverrides the accessible name of the items-per-page select ("Items per page" in English). Unset or empty, the name is in the application's language. See Labels.
itemsPerPageSelectionnumber[]default []Available options for items per page in the dropdown. Example: [10, 25, 50, 100]. The select dropdown is hidden if only one option. See Page size.
lastPageLabelstringOverrides the accessible name of the Last page button. Unset or empty, the name is in the application's language. See Labels.
nextPageLabelstringOverrides the accessible name of the Next page button. Unset or empty, the name is in the application's language. See Labels.
noBorderbooleandefault falseHides the top border. Set to true when used inside a data table that already has borders. See In a bordered table.
pageNumbernumberdefault 0The current page, counted from 0. Set it to change page from code. Setting it fires no event, and a value out of range is clamped to the first or last page. See Position and pages, Page size, Moving by code.
pageStatusFormatter(page: number, total: number) => Promise<string>Custom formatter for the text announced to screen readers when the page changes ("Page 2 of 5" in English). Receives the current page, counted from 1, and the page count, returns a promise of the text. The default text is announced until the promise resolves; a result for a replaced formatter is ignored. See Page size.
positionFormatter(first: number, last: number, total: number) => Promise<string>Custom formatter for the position display text. Receives first item index, last item index, and total count, returns a promise of the display string. The text shows its default (or the last formatted text) until the promise resolves; a result for a replaced formatter is ignored. The default text is already in the application's language; use this to word it differently (e.g., async (f, l, t) => "Showing " + f + " to " + l). See Page size.
previousPageLabelstringOverrides the accessible name of the Previous page button. Unset or empty, the name is in the application's language. See Labels.

Outputs⁠

OutputEventDescription
cwPageNumberChangePageNumberChangeEventWhen the page changes through a button or a page method. It bubbles and is composed. Its detail carries pageNumber.
cwItemsPerPageChangeItemsPerPageChangeEventWhen the user chooses a different items-per-page value. The page number is recomputed without a page-number-change event. It bubbles and is composed. Its detail carries itemsPerPage.

Props⁠

PropTypeDescription
controlsLabelstringOverrides the accessible name of the group holding the controls ("Pagination controls" in English). Unset or empty, the name is in the application's language. See Labels.
disabledbooleandefault falseWhether the paginator controls are disabled. When disabled, the navigation buttons and select are non-interactive, and firstPage(), previousPage(), nextPage() and lastPage() do nothing. See Disabled.
firstPageLabelstringOverrides the accessible name of the First page button. Unset or empty, the name is in the application's language. See Labels.
itemCountnumberdefault 0Total number of items being paginated. Used to calculate the number of pages and position display. See Position and pages.
itemsPerPagenumberdefault 12The number of items on a page. When itemsPerPageSelection is set and does not offer this number, the paginator takes that list's first value. See Position and pages, Page size.
itemsPerPageFormatter(itemsPerPage: number) => Promise<string>Custom formatter for the items-per-page display text. Receives the current items per page value, returns a promise of the display string. The text shows its default (or the last formatted text) until the promise resolves; a result for a replaced formatter is ignored. The default text is already in the application's language; use this to word it differently (e.g., async (n) => n + " rows"). See Page size.
itemsPerPageLabelstringOverrides the accessible name of the items-per-page select ("Items per page" in English). Unset or empty, the name is in the application's language. See Labels.
itemsPerPageSelectionnumber[]default []Available options for items per page in the dropdown. Example: [10, 25, 50, 100]. The select dropdown is hidden if only one option. See Page size.
lastPageLabelstringOverrides the accessible name of the Last page button. Unset or empty, the name is in the application's language. See Labels.
nextPageLabelstringOverrides the accessible name of the Next page button. Unset or empty, the name is in the application's language. See Labels.
noBorderbooleandefault falseHides the top border. Set to true when used inside a data table that already has borders. See In a bordered table.
pageNumbernumberdefault 0The current page, counted from 0. Set it to change page from code. Setting it fires no event, and a value out of range is clamped to the first or last page. See Position and pages, Page size, Moving by code.
pageStatusFormatter(page: number, total: number) => Promise<string>Custom formatter for the text announced to screen readers when the page changes ("Page 2 of 5" in English). Receives the current page, counted from 1, and the page count, returns a promise of the text. The default text is announced until the promise resolves; a result for a replaced formatter is ignored. See Page size.
positionFormatter(first: number, last: number, total: number) => Promise<string>Custom formatter for the position display text. Receives first item index, last item index, and total count, returns a promise of the display string. The text shows its default (or the last formatted text) until the promise resolves; a result for a replaced formatter is ignored. The default text is already in the application's language; use this to word it differently (e.g., async (f, l, t) => "Showing " + f + " to " + l). See Page size.
previousPageLabelstringOverrides the accessible name of the Previous page button. Unset or empty, the name is in the application's language. See Labels.

Events⁠

EventTypeDescription
pageNumberChangePageNumberChangeEventWhen the page changes through a button or a page method. It bubbles and is composed. Its detail carries pageNumber.
itemsPerPageChangeItemsPerPageChangeEventWhen the user chooses a different items-per-page value. The page number is recomputed without a page-number-change event. It bubbles and is composed. Its detail carries itemsPerPage.

Props⁠

PropTypeDescription
controlsLabelstringOverrides the accessible name of the group holding the controls ("Pagination controls" in English). Unset or empty, the name is in the application's language. See Labels.
disabledbooleandefault falseWhether the paginator controls are disabled. When disabled, the navigation buttons and select are non-interactive, and firstPage(), previousPage(), nextPage() and lastPage() do nothing. See Disabled.
firstPageLabelstringOverrides the accessible name of the First page button. Unset or empty, the name is in the application's language. See Labels.
itemCountnumberdefault 0Total number of items being paginated. Used to calculate the number of pages and position display. See Position and pages.
itemsPerPagenumberdefault 12The number of items on a page. When itemsPerPageSelection is set and does not offer this number, the paginator takes that list's first value. See Position and pages, Page size.
itemsPerPageFormatter(itemsPerPage: number) => Promise<string>Custom formatter for the items-per-page display text. Receives the current items per page value, returns a promise of the display string. The text shows its default (or the last formatted text) until the promise resolves; a result for a replaced formatter is ignored. The default text is already in the application's language; use this to word it differently (e.g., async (n) => n + " rows"). See Page size.
itemsPerPageLabelstringOverrides the accessible name of the items-per-page select ("Items per page" in English). Unset or empty, the name is in the application's language. See Labels.
itemsPerPageSelectionnumber[]default []Available options for items per page in the dropdown. Example: [10, 25, 50, 100]. The select dropdown is hidden if only one option. See Page size.
lastPageLabelstringOverrides the accessible name of the Last page button. Unset or empty, the name is in the application's language. See Labels.
nextPageLabelstringOverrides the accessible name of the Next page button. Unset or empty, the name is in the application's language. See Labels.
noBorderbooleandefault falseHides the top border. Set to true when used inside a data table that already has borders. See In a bordered table.
pageNumbernumberdefault 0The current page, counted from 0. Set it to change page from code. Setting it fires no event, and a value out of range is clamped to the first or last page. See Position and pages, Page size, Moving by code.
pageStatusFormatter(page: number, total: number) => Promise<string>Custom formatter for the text announced to screen readers when the page changes ("Page 2 of 5" in English). Receives the current page, counted from 1, and the page count, returns a promise of the text. The default text is announced until the promise resolves; a result for a replaced formatter is ignored. See Page size.
positionFormatter(first: number, last: number, total: number) => Promise<string>Custom formatter for the position display text. Receives first item index, last item index, and total count, returns a promise of the display string. The text shows its default (or the last formatted text) until the promise resolves; a result for a replaced formatter is ignored. The default text is already in the application's language; use this to word it differently (e.g., async (f, l, t) => "Showing " + f + " to " + l). See Page size.
previousPageLabelstringOverrides the accessible name of the Previous page button. Unset or empty, the name is in the application's language. See Labels.

Events⁠

PropTypeDescription
onPageNumberChangePageNumberChangeEventWhen the page changes through a button or a page method. It bubbles and is composed. Its detail carries pageNumber.
onItemsPerPageChangeItemsPerPageChangeEventWhen the user chooses a different items-per-page value. The page number is recomputed without a page-number-change event. It bubbles and is composed. Its detail carries itemsPerPage.

Names and states⁠

A screen reader announces the paginator as a navigation landmark holding a group of controls. It follows no single WAI-ARIA Authoring Practices pattern: its buttons follow the WAI-ARIA Authoring Practices: Button pattern, and its page size field is an ordinary select.

  • The landmark takes its name from an aria-label on the paginator, and is "Pagination navigation", in the application's language, when none is set. Give each paginator its own aria-label when two share a page, such as a table with controls above and below.
  • Only aria-label takes effect on the paginator. Any other aria-* attribute has no effect.
  • The controls sit in a group named "Pagination controls". The four buttons are named "First page", "Previous page", "Next page", and "Last page", and the select is named "Items per page". Each name is in the application's language, and controls-label, first-page-label, previous-page-label, next-page-label, last-page-label and items-per-page-label replace them.
  • A screen reader announces "Page N of M", in the application's language, each time the page changes. pageStatusFormatter words it differently.
  • disabled takes every control out of the Tab order. The first and previous buttons disable on the first page, and the next and last buttons on the last.

Keyboard and focus⁠

Key Action
Tab Moves focus through the enabled buttons and the select, and on to the next control
Enter Activates the focused button
Space Activates the focused button

Tab, Enter, and Space work as they do on any button. The paginator adds no arrow, Home or End keys, so each button is its own Tab stop; the select's keys are the select's own.

  • A focus ring shows on keyboard focus.
  • A disabled button leaves the Tab order, so focus skips first and previous on the first page, and next and last on the last.

Pointer and touch⁠

  • The page buttons are icon buttons, and the paginator sets no touch target of its own, so their size follows the icon button's touch target setting. The row itself is 48 pixels tall.

Display settings⁠

  • Forced colors: the buttons and select follow the system colors.
  • Reduced motion: the paginator adds no motion of its own.
  • In a right-to-left layout the four icons mirror and the row's order reverses.

Standards⁠

With its defaults, the paginator meets four WCAG 2.2 success criteria:

  • 1.3.1 Info and Relationships (A)
  • 2.1.1 Keyboard (A)
  • 2.4.7 Focus Visible (AA)
  • 4.1.2 Name, Role, Value (A)

Two more depend on how you use it:

  • 2.4.6 Headings and Labels (AA): give each paginator its own aria-label when more than one appears on a page.
  • 2.5.8 Target Size (Minimum) (AA): keep the touch target of the page buttons at least 24 by 24 pixels.