Skip to content

components/Stepper

import { … } from 'zidane-ui'ui/src/components/Stepper.tsx

Components#

StepperComponent#

Renders the progress of a wizard as dots or as a rail of step names. The current step carries aria-current="step". When onSelect is set, done steps go back through it.

TypeScript
function Stepper(props: StepperProps): Element
Parameters
NameTypeDescription
propsStepperProps

Component props.

Element
Stepper props
NameTypeDefaultDescription
className?string

Extra classes on the navigation.

currentstring

Id of the current step.

label?string

Accessible name of the navigation. Defaults to the steps label.

onSelect?(id: string) => void

Called with a done step's id when it is clicked. Absent: done steps are not buttons.

stepsreadonly StepperStep[]

The steps, in order.

style?CSSProperties

Inline styles on the root element, merged after the component's own.

variant?'dots' | 'rail''dots'

dots for a top bar, rail for a column of names.

ui/src/components/Stepper.tsx:48

Interfaces#

StepperPropsInterface#

Props for Stepper.

TypeScript
interface StepperProps
StepperProps properties
NameTypeDefaultDescription
className?string

Extra classes on the navigation.

currentstring

Id of the current step.

label?string

Accessible name of the navigation. Defaults to the steps label.

onSelect?(id: string) => void

Called with a done step's id when it is clicked. Absent: done steps are not buttons.

stepsreadonly StepperStep[]

The steps, in order.

style?CSSProperties

Inline styles on the root element, merged after the component's own.

variant?'dots' | 'rail''dots'

dots for a top bar, rail for a column of names.

ui/src/components/Stepper.tsx:22

StepperStepInterface#

One step of a Stepper.

TypeScript
interface StepperStep
StepperStep properties
NameTypeDescription
idstring

Stable id, passed to onSelect.

labelstring

Step name: the rail's text, the dot's tooltip and accessible name.

ui/src/components/Stepper.tsx:12