Stepper
A flexible stepper component for building multi-step workflows, forms, and guided processes with support for linear and non-linear progression.
Installation
Import
import { Stepper, Step } from '@svelte-atoms/core/stepper';Preset Configuration
Customize the stepper appearance using presets
You can customize the default styles for Stepper components by defining presets in your configuration:
Examples
Explore different stepper variations
Basic Stepper
Simple horizontal stepper
1
Account
Enter your details
2
Address
Shipping details
3
Payment
Payment method
4
Review (Optional)
Confirm order
Code
<script lang="ts">
import { Stepper, Step } from '@svelte-atoms/core/stepper';
let activeStep = $state(0);
</script>
<Stepper.Root bind:step={activeStep}>
<Stepper.Header>
{#each steps as stepData, i}
<Step.Root index={i}>
<Step.Header>
<Step.Indicator />
<Step.Title>{stepData.title}</Step.Title>
<Step.Separator />
</Step.Header>
<Step.Body>
<p>{stepData.content}</p>
</Step.Body>
</Step.Root>
{/each}
</Stepper.Header>
<Stepper.Body>
<Stepper.Content />
</Stepper.Body>
<Stepper.Footer>
{#snippet children({ stepper })}
<Button onclick={() => stepper.state.navigation.previous()}>Previous</Button>
<Button onclick={() => stepper.state.navigation.next()}>Next</Button>
{/snippet}
</Stepper.Footer>
</Stepper.Root>Component Structure
The Stepper component consists of two main parts:
Stepper Components
Stepper.Root- Main container managing stateStepper.Header- Container for step indicatorsStepper.Body- Container for step contentStepper.Content- Active step content rendererStepper.Footer- Container for navigation buttons
Step Components
Step.Root- Individual step containerStep.Header- Step header sectionStep.Indicator- Visual step indicatorStep.Title- Step title textStep.Description- Step descriptionStep.Separator- Visual separator between stepsStep.Body- Step content (shown when active)
Properties
Prop
Type
Default
Description
Accessibility
Built-in Accessibility Features
- • Keyboard navigation support
- • ARIA attributes for step status
- • Focus management
- • Screen reader announcements for step changes