Skip to main content

Pagination

Library
UDS Base
Repository
github.com/telus/universal-design-system
Package
npmjs.com/package/@telus-uds/ds-allium
Package version
1.14.0
Loading...

Introduction

import { Pagination } from '@telus-uds/ds-allium'

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.

Platform considerations

The component is available on both native platforms and web.

Keep in mind though that this is a responsive component: it displays less buttons and visually hides the text for Previous and Next buttons when displayed in XS and SM viewports.

Props

Pagination

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

Pagination.PageButton

NameTypeDefaultDescription
copy'en' | 'fr'
disabledbool
hrefstring
hrefAttrs{ download: string, rel: string, target: enum }
isActivebool
labelstring
onPressfunc
onPressInfunc
onPressOutfunc
tokenscustomSystem tokens prop, see tokens for more details
variantobjectOfSystem variant prop, see variants for more details

Note: this component also handles all React Native accessibility props

Tokens

In exceptional circumstances, the following tokens can be passed to these components to override their default styles. Do not do this unless absolutely necessary. Read more about overriding styles.

Pagination

View Tokens
Prop NameToken PropertyToken Type
tokensgapsize
truncateAboveinteger
colorcolor
fontNamefontName
fontWeightfontWeight
fontSizefontSize
lineHeightlineHeight

Pagination.PageButton

View Tokens
Prop NameToken PropertyToken Type
tokensborderColorcolor
borderWidthborder
borderRadiusradius
backgroundColorcolor
paddingLeftsize
paddingRightsize
paddingTopsize
paddingBottomsize
widthsize
outerBorderColorcolor
outerBorderWidthborder
outerBorderGapsize
colorcolor
fontNamefontName
fontWeightfontWeight
fontSizefontSize
lineHeightlineHeight
textAlignflexJustifyContent
textLinetextLine

Figma

Variants

This component does not have any stylistic variants.

Feedback