Pagination

OverviewStyleGuidelinesCodeAccessibilityDemos

Usage

Use pagination to allow users to navigate through large amounts of data or content divided across multiple pages. Pagination should be used if there are 10 - 20 items in one view. However, the default number varies depending on context.

Other options

If you need to use a more simple pagination element within a table or toolbar, the PatternFly pagination component has a less prominent design.

Sizes and style variants

Sizes

While the default size works better in most contexts, the small size can be used for areas with more densely packed content. Include the page input field according to these guidelines:

  • If there are more than seven pages
  • If the page amount is not known or cannot be determined
  • If pagination is used on mobile to ensure that users can access every page without page numbers

Box vs. open

The box variant is the default and button backgrounds help users see the touch targets clearly. The open variant can be used for situations that require a more minimal design.

Behavior

Page input field

The page input field allows users to type their desired page number, this helps avoid clicking the control buttons too much. Users can press the Enter key to jump to that page.

Warning

If there are more than seven pages, the page input field must be visible.

Two groups of pagination; one group shows full sizes with 8 pages and 50 pages of pagination and the other group shows compact sizes with the same amount of pages.

Low page count

In some edge cases, pagination may need to display a very low page count like one.

Helpful tip

Pagination will not be displayed if a search returns zero results or if there is no data or content to list.

Groups of paginations with low page counts; first pagination group shows only 1 page and the second group shows only 3 pages

Disabled butons

When the beginning or end of the pagination range is reached, certain control buttons are disabled.

Paginations with a variety of disabled control buttons

The arrow icon color for disabled buttons in both variants is the same.

Paginations disabled stepper/arrow icons

Truncation

If there are more than seven pages, single or double truncation is displayed based on your location.

Helpful tip

Truncation does not apply to the mobile version because it does not display page numbers.

Paginations with a variety of truncation examples

Layout

Alignment

All of the pagination variants are horizontally centered below content by default.

Four different versions of paginations center aligned to content above.

Responsive design

Helpful tip

The compact configuration appears the same across all screen sizes.

With page input field

As viewport sizes get smaller, pagination will switch sizes to accommodate the page input field if used on the right. All of the variants behave similarly. If the page input field is used below, pagination will not switch sizes as quickly. This works similarly for the box and open variants at both sizes.

Pagination with the page input field on the right

Container widths greater than 768px

Tablet / compact pagination with the page input field on the right

Container widths of 375px - 768px

Mobile / compact pagination with the page input field on the bottom

Container widths less than 375px

Without page input field

When the page input field is not visible, the field will become visible when the default size switches to the mobile version. This works the same for the box and open variants.

Pagination on desktop without the page input field

Container widths greater than 768px

Tablet / compact pagination with the page input field on the right

Container widths of 375px - 768px

Mobile / compact pagination with the page input field on the bottom

Best practices

No input field

Size SM truncated pagination with input below pages.

The page input field needs to be visible when there is truncation or when only the navigation controls are available.

Size SM truncated pagination without an input.

Do not omit the page input field when users do not have the ability to navigate to every page quickly.

Truncation

Size SM truncated pagination with eight pages.

Truncation occurs automatically when there are more than seven pages.

Pagination that is truncating only four pages is incorrect usage

Do not truncate pagination if there are fewer than seven pages.

Order or alignment

Pagination with input field center aligned below pagination

Use the built-in alignment options for the page input field. If your language is read right to left, view the “Right to left” pagination demo.

Truncated pagination with the input field on top and right aligned.

Do not change the order or alignment of the page input field.

Compact vs. mobile

Pagination shown on a mobile device with arrows on top and an input field below.

Use the default mobile style that comes with each variant.

Pagination shown on a mobile device with input field in between arrows.

Do not use the compact configuration in place of the default mobile style of another variant.