Skip to main content

StepTracker

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 { StepTracker } from '@telus-uds/ds-allium'

StepTracker component shows the current position in a sequence of steps. At wide viewports (lg and xl), all steps are labelled, and the current step is highlighted; at narrower viewports, progress through the steps is shown but only the current step has a visible label.

Accessibility

Keep in mind that in its current implementation this is not an interactive component and can’t be used to navigate between steps. The application must provide its own navigation mechanism and state control. That is the main reason the component assumes the progressbar role in terms of accessibility. This also makes it extremely important to make sure you set the necessary accessibility attributes on controls used to modify the state of the step tracker.

That said, you can also pass standard a11y props to the StepTracker component, including the ones that are specific to the progressbar role. By default the following props are used:

  • accessibilityRole (role): progressbar,
  • accessibilityLabel (aria-label): Step I of N: <Current Step Label>,
  • accessibilityLevel (aria-level): 1,
  • accessibilityValue.min (aria-valuemin): 0,
  • accessibilityValue.max (aria-valuemax): steps.length - 1,
  • accessibilityValue.now (aria-valuenow): current,
  • accessibilityValue.text (aria-valuetext): <Current Step Label>,

Platform considerations

The component is available on both native platforms and web.

Props

NameTypeDefaultDescription
copy'en' | 'fr' | dictionaryContentShape'en'
currentnumber0
dictionary{ en, fr }{ en: { stepLabel: 'Step %{stepNumber}', stepTrackerLabel: 'Step %{stepNumber} of %{stepCount}: %{stepLabel}' }, fr: { stepLabel: 'Étape %{stepNumber}', stepTrackerLabel: 'Étape %{stepNumber} sur %{stepCount}: %{stepLabel}' } }
stepsArray<string>[]
tokenscustomSystem tokens prop, see tokens for more details
variantobjectOfSystem variant prop, see variants for more details

Tokens

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

View Tokens
Prop NameToken PropertyToken Type
tokenscompletedIconicon
completedIconColorcolor
completedIconSizesize
connectorColorcolor
connectorCompletedColorcolor
connectorCompletedHeightborder
connectorHeightborder
connectorMinWidthsize
containerPaddingBottomsize
containerPaddingLeftsize
containerPaddingRightsize
containerPaddingTopsize
knobBackgroundColorcolor
knobBorderColorcolor
knobBorderWidthborder
knobCompletedBackgroundColorcolor
knobCompletedBorderColorcolor
knobCompletedPaddingLeftsize
knobCompletedPaddingTopsize
knobCurrentBackgroundColorcolor
knobCurrentBorderColorcolor
knobCurrentBorderWidthborder
knobCurrentInnerColorcolor
knobCurrentInnerSizesize
knobCurrentPaddingLeftsize
knobCurrentPaddingTopsize
knobSizesize
labelColorcolor
labelCurrentColorcolor
labelCurrentFontWeightfontWeight
labelCurrentFontNamefontName
labelDirectiondirection
labelFontSizefontSize
labelFontWeightfontWeight
labelFontNamefontName
labelGapsize
labelLineHeightlineHeight
labelMarginTopsize
labelPaddingLeftsize
labelPaddingRightsize
showStepLabelshow
showStepNameshow
showStepTrackerLabelshow

Figma

Variants

This component does not have any stylistic variants.

Feedback