Skip to main content

Stepper

    Use the Stepper component for a multistep flow in a fixed order, such as a creation wizard. It gives users an overview of all steps and guides them through the steps one by one. Create it with createStepper.

    Note

    See Accessibility in Design Foundations for explanations of key concepts and best practices.

    Keyboard accessibility and focus​

    The step list has one tab stop: the current step. Use the arrow keys to move focus between steps, and press Tab to leave the list.

    KeyBehavior
    Up, LeftMoves focus to the previous step.
    Down, RightMoves focus to the next step.
    Enter, SpaceSelects the focused step. Does nothing on a disabled step.

    After a step change, the Stepper moves focus to the first focusable element in the new step's content. If the content has none, focus goes to the first button in the footer.

    When Next or Finish is refused, focus stays on the button that was pressed. If Finish sends the user to another step, focus moves into that step's content instead.

    • Don't move focus yourself after a step change. The Stepper already moves it into the new step.

    Accessible names and roles​

    The Stepper marks the current step with aria-current="step". A disabled step is marked aria-disabled. It stays reachable with the arrow keys, so screen reader users can find it and hear that it is unavailable.

    • Do give every step a short, distinct Stepper.Title. It names the step in the list and in its panel.
    • Do add aria-label, aria-labelledby, or aria-describedby on Stepper.Step only when the title is not descriptive enough.

    State announcements​

    The Stepper announces changes through live regions. You do not need to add your own.

    EventAnnouncement
    The step changesA polite message, "Step X of N".
    Next or Finish is refusedAn assertive message that names the step. It does not quote your error text.
    Finish is refused and sends the user to another stepThe same message, plus how many steps still need attention. The count is left out when onComplete returns the step to go to.
    An async check is pendingA polite "Loading" message.

    The step list does not rely on color or icons alone. A step with the status invalid or valid also gets the hidden text "(error)" or "(complete)".

    • Do show your error text next to the field, for example with FormFieldMessages.Item. The Stepper announces which step needs attention, but it does not read your message.
    • Do set a Stepper.ErrorMessage so the step list explains the error as well.
    Still have questions?
    Find answers in the Dynatrace Community