Pagination

Divide content into separate pages.

When to use

  • When the user will be searching for information rather than scanning.
  • When the user must maintain a sense of position amonst the paginated elements.

Accessibility

  • Tab moves focus among the focus-able elements (button, dropdown)
  • Escape closes the dropdown once opened
  • Up / Down Arrow Keys are used to navigate the options in the dropdown

Pagination Controlled example

of 20

Pagination Uncontrolled example

of 10

Pagination with Custom Labels

out of 10

Pagination with Overrides

of 10

Overrides

Additionally, you can fully customize any part of the Pagination through the overrides prop. The Pagination consists of multiple subcomponents that are listed bellow and you can override each one of them. To help you identify the names of these subcomponents, you can highlight them through this selector:

of 10

Note: You should always use longhand CSS properties. Mixing shorthands and longhands will lead into strange behaviors!

Pagination API

onPrevClick function

Callback for prev button click.

event exists required *
=> *

onNextClick function

Callback for next button click.

event exists required *
=> *

onPageChange function

Callback for when page changes.

nextPage number required
prevPage number required
=> *

numPages number required

Max number of pages.

currentPage number required

The current page.

labels object = {}

Set of labels to use for the buttons and preposition.

prevButton string
nextButton string
preposition string

overrides object = {}

Root { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*
PrevButton { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*
NextButton { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*
MaxLabel { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*
DropdownContainer { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*
DropdownButton { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*
DropdownMenu { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*

Stateful Pagination API

onPrevClick function

Callback for prev button click.

event exists required *
=> *

onNextClick function

Callback for next button click.

event exists required *
=> *

onPageChange function

Callback for when page changes.

nextPage number required
prevPage number required
=> *

numPages number required

Max number of pages.

labels object

Set of labels to use for the buttons and preposition.

prevButton string
nextButton string
preposition string

stateReducer function = (changeType, changes) => undefined

Reducer function to manipulate internal state updates.

function
$Keys{ changePage: "changePage" },
currentPage number required
,
currentPage number required
=>
currentPage number required

initialState object = { currentPage: 1 }

Initial state populated into the component

currentPage number required

overrides object = {}

Root { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*
PrevButton { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*
NextButton { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*
MaxLabel { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*
DropdownContainer { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*
DropdownButton { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*
DropdownMenu { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>*