Skip to main content
Kobalte

Steps

Since v2.0.0@kobalte/core/stepsSource

An accessible step indicator ("stepper" / wizard) for guiding a user through a sequence of steps.

Import

import { Steps } from "@kobalte/core/steps";
// or
import {
Root,
List,
Item,
Trigger,
Indicator,
Separator,
Content,
CompletedContent,
Progress,
NextTrigger,
PrevTrigger,
} from "@kobalte/core/steps";

Features

  • A fixed number of steps (count), navigated by index.
  • Click a step's trigger to jump directly to it, use NextTrigger/PrevTrigger, or navigate between triggers with the arrow keys (Home/End too) — Enter/Space commits the navigation.
  • Optional linear mode: forward navigation is blocked unless the current step is valid (isStepValid) — this applies uniformly whether navigation comes from a click or the keyboard.
  • Steps can be marked isStepSkippable, bypassing them during next/prev navigation.
  • A dedicated completed state (CompletedContent) once every step is done, announced to assistive technology via role="status".
  • A Progress part (and a --percent CSS variable on the root) for visualizing completion.
  • Can be controlled or uncontrolled.
  • Horizontal or vertical orientation.
  • Built on top of Tabs internally, so triggers get role="tab"/aria-selected and proper roving-tabindex keyboard navigation for free, in addition to Steps-specific aria-current="step" and aria-controls/aria-labelledby linking each trigger to its content.

Anatomy

The steps component consists of:

  • Steps: The root container that manages the current step and provides context.
  • Steps.List: Wrapper for the step items.
  • Steps.Item: The container for a single step.
  • Steps.Trigger: A button that navigates directly to the step it belongs to.
  • Steps.Indicator: A visual marker for a step's status (e.g. its number or a checkmark).
  • Steps.Separator: A divider between two steps, rendered inside Steps.Item.
  • Steps.Content: The content shown while its associated step is current.
  • Steps.CompletedContent: The content shown once every step has been completed.
  • Steps.Progress: A progress bar reflecting how many steps have been completed.
  • Steps.PrevTrigger: A button that returns to the previous step.
  • Steps.NextTrigger: A button that advances to the next step.
<Steps count={3}>
<Steps.List>
{/* one Steps.Item per step */}
<Steps.Item index={0}>
<Steps.Trigger>
<Steps.Indicator />
</Steps.Trigger>
<Steps.Separator />
</Steps.Item>
</Steps.List>
<Steps.Content index={0} />
<Steps.CompletedContent />
<Steps.Progress />
<Steps.PrevTrigger />
<Steps.NextTrigger />
</Steps>

Example

The list of steps isn't a fixed anatomy part — render one Steps.Item (and one Steps.Content) per step yourself, since count is just a number and Kobalte doesn't know what each step should contain.

Create your account by choosing a username and password.
const STEP_TITLES = ["Account", "Profile", "Confirmation"];
function StepIndicator(props: { index: number }) {
return (
<Steps.Indicator class={style.steps__indicator}>
{props.index + 1}
</Steps.Indicator>
);
}
export function BasicExample() {
return (
<Steps count={3}>
<Steps.List class={style.steps__list}>
<For each={STEP_TITLES}>
{(title, index) => (
<Steps.Item index={index()} class={style.steps__item}>
<Steps.Trigger class={style.steps__trigger}>
<StepIndicator index={index()} />
<span class={style.steps__label}>{title}</span>
</Steps.Trigger>
{index() < STEP_TITLES.length - 1 && (
<Steps.Separator class={style.steps__separator} />
)}
</Steps.Item>
)}
</For>
</Steps.List>
<Steps.Content index={0} class={style.steps__content}>
Create your account by choosing a username and password.
</Steps.Content>
<Steps.Content index={1} class={style.steps__content}>
Tell us a bit about yourself.
</Steps.Content>
<Steps.Content index={2} class={style.steps__content}>
Review your details and confirm.
</Steps.Content>
<Steps.CompletedContent class={style.steps__content}>
🎉 All steps completed — you're all set!
</Steps.CompletedContent>
<div class={style.steps__actions}>
<Steps.PrevTrigger class="kb-button">Back</Steps.PrevTrigger>
<Steps.NextTrigger class="kb-button-primary">Next</Steps.NextTrigger>
</div>
</Steps>
);
}
.steps__list {
display: flex;
align-items: center;
}
.steps__item {
display: flex;
flex: 1;
align-items: center;
gap: 8px;
}
.steps__item:last-child {
flex: none;
}
.steps__trigger {
display: flex;
align-items: center;
gap: 8px;
border: none;
background: transparent;
padding: 0;
cursor: pointer;
outline: none;
border-radius: 999px;
}
.steps__trigger:focus-visible {
box-shadow: 0 0 0 2px hsl(200 98% 39% / 0.4);
}
.steps__indicator {
display: flex;
flex-shrink: 0;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 999px;
border: 1.5px solid hsl(240 6% 90%);
color: hsl(240 4% 46%);
font-size: 14px;
font-weight: 600;
transition:
border-color 150ms,
background-color 150ms,
color 150ms;
}
.steps__indicator[data-current],
.steps__indicator[data-complete] {
border-color: hsl(200 98% 39%);
background-color: hsl(200 98% 39%);
color: white;
}
.steps__label {
font-size: 14px;
font-weight: 500;
color: hsl(240 4% 16%);
}
.steps__separator {
flex: 1;
height: 2px;
margin: 0 8px;
background-color: hsl(240 6% 90%);
}
.steps__separator[data-complete] {
background-color: hsl(200 98% 39%);
}
.steps__content {
margin-top: 20px;
border-radius: 8px;
border: 1px solid hsl(240 6% 90%);
padding: 16px;
font-size: 14px;
color: hsl(240 4% 16%);
}
.steps__progress-track {
height: 6px;
width: 100%;
overflow: hidden;
border-radius: 999px;
background-color: hsl(240 5% 94%);
}
.steps__progress-fill {
height: 100%;
background-color: hsl(200 98% 39%);
transition: width 200ms;
}
.steps__list--progress {
margin-top: 16px;
}
.steps__wrapper {
display: flex;
flex-direction: column;
gap: 8px;
}
.steps__actions {
display: flex;
justify-content: space-between;
margin-top: 16px;
}
.steps__status {
font-size: 14px;
color: hsl(240 4% 46%);
margin-top: 8px;
}
.steps__email-label {
display: flex;
flex-direction: column;
gap: 4px;
font-size: 14px;
color: hsl(240 4% 16%);
}
.steps__email-input {
border-radius: 6px;
padding: 6px 12px;
font-size: 14px;
outline: none;
background-color: white;
border: 1px solid hsl(240 6% 90%);
color: hsl(240 4% 16%);
transition: border-color 250ms;
}
.steps__email-input:focus-visible {
outline: 2px solid hsl(200 98% 39%);
outline-offset: 2px;
}
.steps__error {
font-size: 14px;
color: hsl(0 72% 51%);
margin-top: 8px;
}
[data-theme*="dark"] .steps__indicator {
border-color: hsl(240 5% 34%);
color: hsl(0 100% 100% / 0.6);
}
[data-theme*="dark"] .steps__label {
color: hsl(0 100% 100% / 0.9);
}
[data-theme*="dark"] .steps__separator {
background-color: hsl(240 5% 34%);
}
[data-theme*="dark"] .steps__content {
border-color: hsl(240 5% 34%);
color: hsl(0 100% 100% / 0.9);
}
[data-theme*="dark"] .steps__progress-track {
background-color: hsl(240 4% 24%);
}
[data-theme*="dark"] .steps__status {
color: hsl(240 5% 65%);
}
[data-theme*="dark"] .steps__email-label {
color: hsl(0 100% 100% / 0.9);
}
[data-theme*="dark"] .steps__email-input {
background-color: hsl(240 4% 16%);
border-color: hsl(240 5% 34%);
color: hsl(0 100% 100% / 0.9);
}

Usage

Controlled value

The value and onChange props can be used to make the current step controlled.

Current step index: 0

import { createSignal } from "solid-js";
function ControlledExample() {
const [value, setValue] = createSignal(0);
return (
<>
<Steps count={3} value={value()} onChange={setValue}>
{/* ...list, content... */}
</Steps>
<p>Current step index: {value()}</p>
</>
);
}

Progress

Steps.Progress renders as the fill of a progress bar (sized via width) — wrap it in your own track element. The root also exposes a --percent CSS variable for custom styling.

<Steps count={4}>
<div class="steps__progress-track">
<Steps.Progress class="steps__progress-fill" />
</div>
{/* ...list... */}
</Steps>
.steps__progress-track {
height: 6px;
border-radius: 999px;
background-color: hsl(240 5% 94%);
overflow: hidden;
}
.steps__progress-fill {
height: 100%;
background-color: hsl(200 98% 39%);
transition: width 200ms;
}

Linear mode

Set linear to require the steps to be completed in order. Provide isStepValid to gate forward navigation — clicking a step's trigger more than one step ahead, or calling Steps.NextTrigger while the current step is invalid, is blocked and fires onStepInvalid instead. Going backward is always allowed.

function LinearExample() {
const [email, setEmail] = createSignal("");
return (
<Steps
count={3}
linear
isStepValid={index => index !== 0 || email().includes("@")}
onStepInvalid={() => alert("Enter a valid email first.")}
>
<Steps.Content index={0}>
<input value={email()} onInput={e => setEmail(e.currentTarget.value)} />
</Steps.Content>
{/* ...remaining steps... */}
</Steps>
);
}

Skippable steps

Provide isStepSkippable to bypass certain steps when navigating with Steps.NextTrigger/Steps.PrevTrigger. A skippable step is still reachable by clicking its Steps.Trigger directly.

Step 1 (normal)
<Steps count={4} isStepSkippable={index => index === 2}>
{/* ...list, content... */}
</Steps>

API Reference

Steps

Steps is equivalent to the Root import from @kobalte/core/steps.

PropDescription
countnumber
The total number of steps. Required.
valuenumber
The controlled index of the current step.
defaultValuenumber
The index of the current step when initially rendered. Useful when you do not need to control the state.
onChange(value: number) => void
Event handler called when the current step changes.
orientation'horizontal' | 'vertical'
The orientation of the steps. Defaults to 'horizontal'.
linearboolean
Whether the user must complete the steps in order. Defaults to false.
isStepValid(index: number) => boolean
Returns whether the step at index is valid, used to gate forward navigation when linear is true. Defaults to always true.
isStepSkippable(index: number) => boolean
Returns whether the step at index should be skipped over by next/prev navigation. Defaults to always false.
onStepComplete() => void
Event handler called once when every step has been completed.
onStepInvalid(details: { step: number }) => void
Event handler called when navigation is blocked by an invalid step in linear mode.
idstring
A unique identifier. Auto-generated if not provided.
Data attributeDescription
data-orientationReflects the orientation prop.

Steps.List

Wraps the step items. Internally wraps Tabs.List, which is what gives roving-tabindex arrow-key (and Home/End) navigation between triggers, along with role="tablist" and aria-orientation.

No props beyond the common polymorphic/HTML ones.

Data attributeDescription
data-orientationReflects the orientation prop.

Steps.Item

PropDescription
indexnumber
The index of this step. Required.
Data attributeDescription
data-complete / data-current / data-incompleteReflects the step's status relative to the current step.

Steps.Trigger, Steps.Indicator, and Steps.Separator read this status from context — Steps.Separator should be rendered as a child of Steps.Item, alongside Steps.Trigger.

Steps.Trigger

A button that navigates directly to the step it belongs to. Wraps Tabs.Trigger internally, so clicking it (or pressing Enter/Space while it's focused) selects it — this is routed through linear/isStepValid validation before the current step is allowed to change. It also inherits Tabs.Trigger's own role="tab", aria-selected, data-selected, and data-highlighted.

No props beyond the common polymorphic/HTML ones.

Steps.Trigger and Steps.Content for the same index are automatically cross-referenced for assistive technology: Steps.Trigger gets aria-controls pointing at its Steps.Content's id, and Steps.Content gets aria-labelledby pointing back at the trigger — an id is generated for both if you don't provide one yourself. Steps.Trigger also sets aria-current="step" while it's the current step.

Data attributeDescription
data-orientationReflects the orientation prop.
data-state"open" while it's the current step, "closed" otherwise.
data-complete / data-current / data-incompleteReflects the step's status relative to the current step.

Steps.Indicator

A visual marker for a step's status (e.g. its number or a checkmark), typically rendered inside Steps.Trigger. Renders whatever children you provide — style it using the data attributes below.

No props beyond the common polymorphic/HTML ones.

Data attributeDescription
data-complete / data-current / data-incompleteReflects the step's status relative to the current step.

Steps.Separator

A purely decorative divider between two steps, rendered as a child of Steps.Item, reflecting the status of the step it follows. Hidden from assistive technology (aria-hidden="true"), matching Breadcrumbs.Separator. Typically hidden visually after the last item via a :last-child CSS rule.

No props beyond the common polymorphic/HTML ones.

Data attributeDescription
data-complete / data-current / data-incompleteReflects the step's status relative to the current step.

Steps.Content / Steps.CompletedContent

PropDescription
indexnumber
(Steps.Content only) The index of the step this content belongs to. Required.
forceMountboolean
Used to force mounting when more control is needed. Useful when controlling animation with SolidJS animation libraries.
Data attributeDescription
data-current(Steps.Content only) Present while its associated step is the current one.

Steps.CompletedContent renders with role="status" (a polite live region) — completing a wizard is a positive, non-urgent update rather than an error, so status is used instead of the more disruptive alert.

Steps.NextTrigger / Steps.PrevTrigger

Buttons that advance to the next step or return to the previous one. Steps.NextTrigger is subject to linear/isStepValid/isStepSkippable. Both wrap Button.Root; onClick is composed with the built-in navigation handler rather than replaced by it.

No props beyond the common polymorphic/HTML ones (plus onClick).

Steps.NextTrigger is disabled when hasNextStep is false; Steps.PrevTrigger is disabled when hasPrevStep is false.

Steps.Progress

A progress bar reflecting how many steps have been completed. Renders as the fill itself (sized via a width style based on percent) — wrap it in your own track element.

No props beyond the common polymorphic/HTML ones.

Data attributeDescription
data-completePresent once every step has been completed.

Steps.Progress renders with role="progressbar", aria-valuenow (the current step index), aria-valuemin={0}, and aria-valuemax (the step count).

useStepsContext

Returns the StepsContextValue object. Must be called inside a Steps. Used to build custom sub-components, or to drive navigation programmatically.

PropertyTypeDescription
valueAccessor<number>The index of the current step (equals count once completed).
countAccessor<number>The total number of steps.
percentAccessor<number>The completion percentage, between 0 and 100.
hasNextStepAccessor<boolean>Whether there is a step after the current one.
hasPrevStepAccessor<boolean>Whether there is a step before the current one.
isCompletedAccessor<boolean>Whether every step has been completed.
isStepValid(index: number) => booleanReturns whether the step at index is valid.
isStepSkippable(index: number) => booleanReturns whether the step at index should be skipped over by next/prev navigation.
getItemState(index: number) => "complete" | "current" | "incomplete"Returns the current status of the step at index.
canChangeStep(index: number) => booleanReturns whether navigating directly to index is currently allowed.
changeStep(index: number) => voidNavigates to index if canChangeStep(index), otherwise fires onStepInvalid.
setStep(index: number) => voidDirectly sets the current step, clamped to [0, count]. Not subject to linear validation.
goToNextStep() => voidAdvances to the next (non-skipped) step, subject to linear validation.
goToPrevStep() => voidReturns to the previous (non-skipped) step.
resetStep() => voidResets to the first step.

Rendered elements

ComponentDefault rendered element
Stepsdiv
Steps.Listdiv
Steps.Itemdiv
Steps.Triggerbutton
Steps.Indicatordiv
Steps.Separatordiv
Steps.Contentdiv
Steps.CompletedContentdiv
Steps.Progressdiv
Steps.PrevTriggerbutton
Steps.NextTriggerbutton

Accessibility

Keyboard Interactions

Steps.Trigger always uses manual activation: the arrow keys (and Home/End) only move roving focus between triggers, they never change the current step on their own — appropriate for a step wizard, where focusing the next trigger to "just look" at it shouldn't silently advance the stepper. Enter/Space commits the navigation, subject to linear/isStepValid validation.

KeyDescription
TabMoves focus to the first (or last active) trigger. Once focused, arrow keys navigate the remaining triggers.
ArrowDownMoves focus to the next trigger in vertical orientation.
ArrowRightMoves focus to the next trigger in horizontal orientation.
ArrowUpMoves focus to the previous trigger in vertical orientation.
ArrowLeftMoves focus to the previous trigger in horizontal orientation.
HomeMoves focus to the first trigger.
EndMoves focus to the last trigger.
EnterNavigates to the focused trigger's step, subject to linear/isStepValid validation.
SpaceNavigates to the focused trigger's step, subject to linear/isStepValid validation.

Last updated: 11/28/26, 9:28 PM