Skip to main content

Pagination

Library
UDS Base
Repository
github.com/telus/universal-design-system
Package
npmjs.com/package/@telus-uds/components-base
Package version
1.6.1
Loading...

Introduction

import { Pagination } from '@telus-uds/components-base'

Pagination can be used to enable a user to page through local page content or via links.

Guidance

  • Pagination component accepts one or multiple Pagination.PageButton components as children and renders all or some of them (replacing the missing part with an ellipsis when there are too many pages available).
  • Use onPress prop of the Pagination.PageButton component to handle the navigation.
  • Alternatively, you can use the href and hrefAttrs props of the Pagination.PageButton for browser-based navigation.
  • Use the isActive prop of the Pagination.PageButton component to indicate the button corresponding to the current page.
  • Use copy prop (on both Pagination and Pagination.PageButton components) to specify the language of the labels or provide a custom dictionary.

Accessibility

The Pagination component itself does not accept any accessibility attributes. Pagination.PageButton, however, accepts standard accessibility props, including the ones that are specific to the button role. By default accessibility role is set to 'button' (or to link if href prop is set) and the accessibility label is based on the value of the label prop.

Props

Pagination

NameTypeDefaultDescription
copy'en' | 'fr''en'
LinkRouterelementType
linkRouterPropsobject
childrencustom
variantobjectOfSystem variant prop, see variants for more details
tokenscustomSystem tokens prop, see tokens for more details
sideButtonVariantobjectOf
sideButtonTokenscustom

Pagination.PageButton

NameTypeDefaultDescription
onPressfunc
onPressInfunc
onPressOutfunc
disabledbool
hrefstring
hrefAttrsshape
labelstring
isActivebool
copy'en' | 'fr'
variantobjectOfSystem variant prop, see variants for more details
tokenscustomSystem tokens prop, see tokens for more details

Note: this component also handles all React Native accessibility props