Pagination

Pagination is a technique used to divide large amounts of table data into smaller, easier to manage blocks. Pagination improves usability of tables by reducing the amount of information presented to the user at one time. For longer pages, opt for pagination instead of infinite scrolling. Pagination ensures content is easily trackable and always visible, enhancing accessibility.

Interactive Playground

The Interactive Playground allows you to experiment with various pagination styles and features. Once you get the results you want, copy the HTML or React code provided and paste it into your application.

<div
class="neo-pagination__row"
id="pagination-:R0:"
>
<nav class="neo-pagination neo-pagination__condensed">
<button
type="button"
disabled
aria-label="previous"
class="neo-btn-square neo-pagination__arrow-btn neo-icon-chevron-left"
>
</button>
<div class="pagination__go-to-page">
<div
data-testid="NeoInputWrapper-root"
class="neo-form-control"
>
<div
data-testid="NeoInputWrapper-group-root"
class="neo-input-group"
>
<div class="neo-input-editable__wrapper">
<input
class="neo-input"
id=":Rd:"
tabindex="0"
type="number"
aria-label="Go to page"
pattern="[0-9]+"
min="1"
max="5"
value="1"
>
</div>
</div>
</div>
<span>
/ 5
</span>
<span>
pages
</span>
</div>
<button
type="button"
aria-label="next"
class="neo-btn-square neo-pagination__arrow-btn neo-icon-chevron-right"
>
</button>
</nav>
</div>
<Pagination
alwaysShowPagination
currentPageIndex={1}
itemCount={100}
itemDisplayType="count"
itemsPerPage={20}
itemsPerPageOptions={[
20,
50,
100
]}
onItemsPerPageChange={function noRefCheck() {}}
onPageChange={function noRefCheck() {}}
/>

Anatomy

Shown below are the parts that make up a pagination component.

Displays the anatomy of a pagination starting with the page count on the left side, followed by the interface for the page navigation. Inside the navigation is two arrow buttons, a first and last page button, your current page button and three dots to convey hidden pages. On the right side there is a jump to page button and a display count drop down
  • Page Count:

    Shows the range of items (rows) displayed compared to the total number of items in the table.
  • Previous Page:

    Navigate to the previous page of data. This option is disabled if you are already at page 1.
  • First Page:

    Takes the user to the first page of the table. It is always visible in the pagination bar.
  • Hidden Pages:

    Ellipses indicate that additional pages exist in the sequence but are not displayed.
  • Current Page:

    Is highlighted with a blue background.
  • Last Page:

    Takes the user to the last page of the table. It is always visible in the pagination bar.
  • Next Page:

    Navigate to the next page of data. This option is disabled if you are already on the last page.
  • Jump to Page:

    Enter the page number in this space to jump directly to that page of the table.
  • Display Count:

    Displays the number of rows to display. This is user configurable but defaults to increments of 20, 50, or 100.

States

The page numbers can have one of 3 states.

Default
Page numbers with default state look like this.
Hover
Page numbers with hover state look like this
Active
Page numbers with active state look like this
  • Default:

    The page is unselected, allowing users to select and navigate to that specific page.
  • Hover:

    The page is highlighted and can be selected.
  • Active:

    The current page shown on the screen.

Behavior

The implementation of pagination varies depending upon the size of the table and the size of the page showing the data.

Placement

The pagination bar is always visible and positioned at the bottom of the viewable page.

Shows appropriate positioning for the pagination bar.

On pages with fewer rows, the pagination stays visible at the bottom of the page, not directly beneath the last row.

Shows appropriate positioning for the pagination bar with pages with fewer rows.
image showing the pagination component fixed at bottom of the page.

DO: The pagination remains fixed at the bottom of the page, ensuring it is always visible.

image showing the pagination component above the table.

DON'T: Do not place the pagination above the table.

Items Per Page

The number of rows to show in a table depends on how much data is being presented, the screen size and resolution of the device being used, and user preferences.

The user can choose to display 20, 50, or 100 rows of data per page. The default value is 20 rows per page.

Shows how items per a page can effect the pagination bars position on a device.

Variations

Pagination comes in two forms: full and condensed. Use the full version when there is ample space to display all details. Select the condensed version when space is limited. If there are no additional pages, a pagination bar is unnecessary.

Full version
Shows image of the full version of the pagination bar.
Condensed version
Shows image of the condensed version of the pagination bar.

Specs

Use the diagram below to build a pagination bar.

Displays some spacing methods and sizes for a pagination bar.

Keyboard Interactions

This section illustrates keyboard interactions for the Pagination component.

Keystrokes Interaction
Tab Moves to the next numbered page.
Shift + Tab Moves to the previous numbered page.
Enter or Spacebar Opens the selected page, or opens the dropdown.

Components