React playground

Nova v3.37.0

Preview

React

Table pagination

nv-paginationtable

Paging controls for a table, with first/previous/next/last buttons, the current page, the row total and a page-size choice.

Live demo

Overview

Use table pagination below a table whose rows don't fit on one page. It moves page by page or to the first and last page, shows "Page 2 of 5" and the row total, and lets people choose 10, 25, 50 or 100 rows per page. It doesn't show page numbers; for numbered navigation through lists or results, use pagination.

Anatomy

Table pagination with five callouts: 1 marks the first-page button, 2 the previous-page button, 3 the Page 1 of 26 indicator, 4 the total of 254 rows, and 5 the page-size selector showing 10 per page.

The parts of table pagination.
  1. First and last page buttons jump to either end of the table; hideFirstLast removes them.
  2. Previous and next page buttons move one page at a time; hidePrevNext removes them. Backward controls are disabled on the first page, and forward controls on the last. hideControls removes all controls.
  3. Page indicator: Page {pageIndex} of {pageCount}. pageIndex starts at 0 in code but the label shows it from 1.
  4. Row count: Total: {rowCount} rows.
  5. Page size selector: a select with {pageSize} per page options.

The labels are templates you can translate or shorten. An empty labelPage or labelTotal hides that label.

Properties

Design settingCodeMapping
Show controlshideControlsInverse setting; false keeps navigation visible.
First/last controlshideFirstLastRemoves only the two end controls.
Previous/next controlshidePrevNextRemoves only adjacent-page controls.
Page informationlabelPageTemplate using {pageIndex} and {pageCount}; an empty value hides it.
Row informationlabelTotalTemplate using {rowCount}; an empty value hides it.
Page sizepageSize, pageSizeOptions, labelPageSizeOptionDefaults to 10, with 10/25/50/100 options and a {pageSize} label template.
Current pagepageIndexZero-based; displayed page numbers are one-based.
TotalspageCount, rowCountSupplied by the application; both default to 0.
ChangespageIndexChanged, pageSizeChangedEmit the new numeric value.

Look and feel

The design offers compositions with optional controls, counts and page-size selection in Spark and Ocean, light and dark. Empty label templates hide the counts, and the three hide* properties configure navigation. This version always renders the page-size selector; there is no property to hide it.

first page · first and previous disabled
pageIndex="2" · page 3 of 5
hideFirstLast

Behavior

  • Your application owns the rows. Pass pageCount and rowCount from the data you show, and slice the visible rows from pageIndex and pageSize.
  • Return to the first page when the page size or a filter changes, so the current page always exists.
  • Keep the pager close to the table it controls.

Accessibility

The host is a pagination navigation region. The design calls for meaningful names on all four paging buttons, a labelled page-size selector and an announcement after a page change. The current inner controls expose generic icon names and no explicit select label, so those naming requirements remain an implementation gap. Announce result/page changes from the application, for example through a polite status region.

Usage

Keep the controls and useful counts directly below the table. Removing all navigation leaves users unable to move between pages unless the application provides another navigation mechanism. Translate the label templates for the application's locale.

Related

Use with Datatable. For numbered links through lists or search results, use Pagination nav.

Sources