shadcn.io is not affiliated with official shadcn/ui
Components
Free
Steps for Svelte
Keep an ordered flow on the current step, with a way to move forward or back. For Svelte with Ark UI, when later steps depend on the ones that came before.
Framework
UI library
Walk a wizard or a checkout one step at a time, with Back and Next under the current step.
Use them when later steps depend on earlier ones. Panels with no required order are Tabs. In Svelte, Ark UI tracks the index from zero, including which steps are complete.
Installation
Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.
Moves focus onto the list's one stop: the current step's trigger, or the last trigger once every step is done. The content isn't a stop of its own.
Arrow Right
Moves focus to the next enabled trigger in horizontal orientation (the previous one in right-to-left), wrapping round.
Arrow Left
Moves focus to the previous enabled trigger in horizontal orientation (the next one in right-to-left), wrapping round.
Arrow Down
Moves focus to the next enabled trigger in vertical orientation, wrapping round.
Arrow Up
Moves focus to the previous enabled trigger in vertical orientation, wrapping round.
Home
Moves focus to the first enabled trigger.
End
Moves focus to the last enabled trigger.
Enter
Opens the focused trigger's step, or activates the focused control.
Space
Opens the focused trigger's step, or activates the focused control.
Demos
Controlled
Your details, company details, then invite your team. Back, Next, and Reset are ordinary buttons that store the index in step. Control it when a parent, a query param, or a save has to move the wizard. The built-in next and previous parts are enough when nothing outside cares, and Reset returns to index zero, the first step.
Description
Each trigger has a title and a short description: Info with Personal, Docs with Company, Team with Create. StepsTitle and StepsDescription live on the list, so a step says what it holds before it opens. Keep the description to a couple of words, because a sentence in the trigger wraps the row. Longer copy belongs in the step body, which is not part of this list.
Icon
Indicators show a person, a drive, and a card instead of numbers. An icon helps when the step is recognizable: account, then storage, then payment. There is no title beside the icon, which suits a compact rail and fails if the picture is ambiguous. Add StepsTitle when the metaphor is unclear, and hide the icon once a title names the step.
Loading
The first indicator spins, the others stay numbers, and every trigger is disabled. That is a step saving or checking before anyone may move on. Put the loader in the indicator instead of a second spinner beside the wizard. Disabled triggers block a later step while the request runs, and they should come back on when the check finishes.
Title
Numbers plus a name: Info, Docs, and Team. StepsTitle is the smallest label that explains a sequence without opening each step. Use it when position alone is not obvious, because three bare circles force a guess and there is no second line to help. If one word is not enough, add a short description rather than stretching the title into a sentence.
Vertical
The list stacks, separators run between the steps, and the current content sits beside that list. Set orientation to vertical for a side column next to a preview. Across the top of a narrow form, horizontal wastes less height. Next and Back stay with the content, and a completed message replaces the panel after the last step.
FAQ
How do I build a multi-step form wizard with Steps in Svelte?
Set count to the number of steps, render a StepsContent with an index for each step's fields, and add StepsPrevious and StepsNext to move between them. StepsCompletedContent shows once the last step is done, as in the default demo.
How do I control the current step of Steps?
Keep the step index in state and pass it as step; it starts at 0. Use defaultStep instead when you only need the starting step.
onStepChange receives details.step, as in the Controlled demo.
How do I stop Steps from moving forward until a step is valid?
Pass isStepValid, a function of the step index that returns whether that step is complete. While it returns false, the Steps stay on that step and onStepInvalid is called, so you can show the errors.
Can users skip ahead to a later step?
By default they can click any step's trigger. Set linear to make them go through the steps in order, and use isStepSkippable to mark optional steps they may pass over.
How do I show Steps vertically?
Set orientation="vertical": the list stacks the steps and the separators run between them, as in the Vertical demo. It suits a side column next to the content of the current step.
How do I style completed and current Steps?
Each trigger, indicator and separator carries its state as data attributes: data-complete, data-current and data-incomplete. Target them with classes like data-complete:bg-primary, or edit the Steps file in your ui folder.
How do I install Steps in Svelte?
Run the command in the Installation section above: it adds Steps to your ui folder and installs Ark UI. Steps is built on Ark UI on every base and framework, so the API is the same everywhere.
The command uses the shadcn-svelte CLI.
API Reference
Steps
<div>data-slot="steps"
PropType
step?number
The controlled value of the stepper.
defaultStep?number
The initial value of the stepper when rendered.
Use when you don't need to control the value of the stepper.