Live demo
Demo source
Use pagination when a list, search result or table is too long to show at once. It shows which page is open, lets people jump to a page by number, and moves one page with Previous and Next. For tables that also need a page-size choice and first and last controls, use table pagination.
States
Page buttons have default, hover and active appearances; the active one marks the current page. Previous is disabled at the beginning and Next at the end. Keep that distinction visible so people know where they are in the result set. Keyboard focus should remain visible as people move between controls.
Anatomy
Pagination reading Previous, 1, 2, an ellipsis, 9, 10 and Next, with four callouts: 1 marks the Previous button, 2 the highlighted current page 2, 3 the ellipsis, and 4 the whole pagination.
- Previous and Next use
emphasis="lower". They are disabled on the first and last page; withisOnlyIconthey become icon buttons named bypreviousButtonLabelandnextButtonLabel. - Page buttons show page numbers. The current page is highlighted.
- Ellipsis stands for hidden pages. It isn't a button and is hidden from assistive technology.
- Pagination is a
navthat wraps the buttons in an ordered list.
Pages and range
Pagination counts pages from totalCount and pageSize, and currentPage
starts at 1. Clicking a page updates currentPage and emits
currentPageChanged; your application shows the matching items.
numStartZoneButtons and numEndZoneButtons (2 each by default) set how many
pages stay visible at each end. For long ranges, add showMiddleZone so the
current page and numMiddleButtons neighbours appear between two ellipses.
The design recommends around five visible page numbers. Adjust the start,
end and middle counts to keep the range compact on smaller screens.
Appearance and usage
The navigation uses theme tokens for Spark and Ocean in light and dark modes.
Keep it aligned with the list, gallery or table it controls, and use short
labels for Previous and Next, including translations. Load the requested
page's content in response to currentPageChanged; the component only manages
the navigation controls.