Steps
A multi-step progress indicator for guiding users through a sequence of steps.
Anatomy
<script>
import { Steps } from "@saas-ui/svelte/components/steps";
</script>
<Steps.Root count={3}>
<Steps.List>
<Steps.Item index={0}>
<Steps.Trigger>
<Steps.Indicator />
Step 1
</Steps.Trigger>
<Steps.Separator />
</Steps.Item>
<Steps.Item index={1}>
<Steps.Trigger>
<Steps.Indicator />
Step 2
</Steps.Trigger>
<Steps.Separator />
</Steps.Item>
<Steps.Item index={2}>
<Steps.Trigger>
<Steps.Indicator />
Step 3
</Steps.Trigger>
</Steps.Item>
</Steps.List>
<Steps.Content index={0}>Content for step 1</Steps.Content>
<Steps.Content index={1}>Content for step 2</Steps.Content>
<Steps.Content index={2}>Content for step 3</Steps.Content>
<Steps.CompletedContent>All steps completed!</Steps.CompletedContent>
</Steps.Root>Examples
Basic Accessibility
<Steps.Root defaultStep={1} count={3}>
<Steps.List>
<Steps.Item index={0} title="Step 1" />
<Steps.Item index={1} title="Step 2" />
<Steps.Item index={2} title="Step 3" />
</Steps.List>
<Steps.Content index={0}>Step 1 content</Steps.Content>
<Steps.Content index={1}>Step 2 content</Steps.Content>
<Steps.Content index={2}>Step 3 content</Steps.Content>
<Steps.CompletedContent>All steps are complete!</Steps.CompletedContent>
<Group>
<Steps.PrevTrigger>Prev</Steps.PrevTrigger>
<Steps.NextTrigger>Next</Steps.NextTrigger>
</Group>
</Steps.Root> Colours Accessibility
colour prop to change the colour theme.
<VStack gap={10}>
{#each colours as colour}
<HStack gap={4} class="items-center">
<Text size="xs" class="w-16">{colour}</Text>
<Steps.Root {colour} defaultStep={1} count={3} class="flex-1">
<Steps.List>
<Steps.Item index={0} title="Step 1" />
<Steps.Item index={1} title="Step 2" />
<Steps.Item index={2} title="Step 3" />
</Steps.List>
</Steps.Root>
</HStack>
{/each}
</VStack> Description Accessibility
description prop to add descriptions to steps.
<Steps.Root defaultStep={1} count={3}>
<Steps.List>
<Steps.Item index={0} title="Step 1" description="This step" />
<Steps.Item index={1} title="Step 2" description="That step" />
<Steps.Item index={2} title="Step 3" description="Final step" />
</Steps.List>
<Steps.Content index={0}>Step 1</Steps.Content>
<Steps.Content index={1}>Step 2</Steps.Content>
<Steps.Content index={2}>Step 3</Steps.Content>
<Steps.CompletedContent>All steps are complete!</Steps.CompletedContent>
<Group>
<Steps.PrevTrigger>Prev</Steps.PrevTrigger>
<Steps.NextTrigger>Next</Steps.NextTrigger>
</Group>
</Steps.Root> Icon Accessibility
icon prop to display custom icons.
<Steps.Root defaultStep={1} count={3}>
<Steps.List>
<Steps.Item index={0} icon={User} aria-label="Contact Details" />
<Steps.Item index={1} icon={Wallet} aria-label="Payment" />
<Steps.Item
index={2}
icon={CalendarBlank}
aria-label="Appointment"
/>
</Steps.List>
<Steps.Content index={0}>Contact Details</Steps.Content>
<Steps.Content index={1}>Payment</Steps.Content>
<Steps.Content index={2}>Book an Appointment</Steps.Content>
<Steps.CompletedContent>All steps are complete!</Steps.CompletedContent>
<Group>
<Steps.PrevTrigger>Prev</Steps.PrevTrigger>
<Steps.NextTrigger>Next</Steps.NextTrigger>
</Group>
</Steps.Root> Sizes Accessibility
size prop to change the size of the steps.
<VStack gap={16}>
{#each stepsSizes as size}
<Steps.Root {size} count={3}>
<Steps.List>
<Steps.Item index={0} title="Step 1" />
<Steps.Item index={1} title="Step 2" />
<Steps.Item index={2} title="Step 3" />
</Steps.List>
<Steps.Content index={0}>Step 1 content</Steps.Content>
<Steps.Content index={1}>Step 2 content</Steps.Content>
<Steps.Content index={2}>Step 3 content</Steps.Content>
<Steps.CompletedContent>All steps are complete!</Steps.CompletedContent>
<Group>
<Steps.PrevTrigger>Prev</Steps.PrevTrigger>
<Steps.NextTrigger>Next</Steps.NextTrigger>
</Group>
</Steps.Root>
{/each}
</VStack> Variants Accessibility
variant prop to change the visual style.
<VStack gap={16}>
{#each ["subtle", "solid"] as variant (variant)}
<Steps.Root
variant={variant as "subtle" | "solid"}
defaultStep={1}
count={3}
>
<Steps.List>
<Steps.Item index={0} title="Step 1" />
<Steps.Item index={1} title="Step 2" />
<Steps.Item index={2} title="Step 3" />
</Steps.List>
<Steps.Content index={0}>Step 1</Steps.Content>
<Steps.Content index={1}>Step 2</Steps.Content>
<Steps.Content index={2}>Step 3</Steps.Content>
<Steps.CompletedContent>All steps are complete!</Steps.CompletedContent>
<Group>
<Steps.PrevTrigger>Prev</Steps.PrevTrigger>
<Steps.NextTrigger>Next</Steps.NextTrigger>
</Group>
</Steps.Root>
{/each}
</VStack> Vertical Accessibility
orientation="vertical" for vertical steps.
<Steps.Root
orientation="vertical"
class="h-[400px]"
defaultStep={1}
count={3}
>
<Steps.List>
<Steps.Item index={0} title="Step 1" />
<Steps.Item index={1} title="Step 2" />
<Steps.Item index={2} title="Step 3" />
</Steps.List>
<Stack>
<Steps.Content index={0}>Step 1 content</Steps.Content>
<Steps.Content index={1}>Step 2 content</Steps.Content>
<Steps.Content index={2}>Step 3 content</Steps.Content>
<Steps.CompletedContent>All steps are complete!</Steps.CompletedContent>
<Group>
<Steps.PrevTrigger>Prev</Steps.PrevTrigger>
<Steps.NextTrigger>Next</Steps.NextTrigger>
</Group>
</Stack>
</Steps.Root>Props
Steps.Root
The root container component for the steps.
| Prop | Type | Default | Description |
|---|---|---|---|
children | Snippet | - | Content to render inside the steps (composition API). |
count | number | - | The total number of steps. |
defaultStep | number | 0 | The initial step (0-indexed). |
step | number | - | The controlled current step. |
size | "sm" | "md" | "lg" | "md" | The size of the steps. |
variant | "subtle" | "solid" | "solid" | The visual variant. |
orientation | "horizontal" | "vertical" | "horizontal" | The orientation of the steps. |
colour | ColourName | "gray" | The colour palette. |
linear | boolean | false | Whether the steps must be completed in order. |
onStepChange | (details: { step: number }) => void | - | Callback when the step changes. |
onStepComplete | () => void | - | Callback when all steps are completed. |
class | string | - | Additional CSS classes to apply. |
onPrefetch | (index: number) => void | - | Callback invoked when hovering over a step (for prefetching content). Receives the step index. Similar to Astro's link prefetching, this allows preloading data before selection. |
Steps.List
Container for the step items.
| Prop | Type | Default | Description |
|---|---|---|---|
children | Snippet | - | The step items to render. |
class | string | - | Additional CSS classes to apply. |
Steps.Item
A single step item containing a trigger and separator.
| Prop | Type | Default | Description |
|---|---|---|---|
index | number | - | The index of this step (0-indexed). |
title | string | - | The title of this step. |
description | string | - | The description of this step. |
icon | Component<any> | - | Custom icon component to display instead of number. |
children | Snippet | - | Custom content for the step item. |
class | string | - | Additional CSS classes to apply. |
Steps.Trigger
The clickable trigger for a step.
| Prop | Type | Default | Description |
|---|---|---|---|
index | number | - | The index of this step. |
children | Snippet | - | The content of the trigger. |
class | string | - | Additional CSS classes to apply. |
Steps.Indicator
The visual indicator for a step (shows number or icon).
| Prop | Type | Default | Description |
|---|---|---|---|
index | number | - | The index of this step. |
current | boolean | false | Whether this step is the current step. |
completed | boolean | false | Whether this step is completed. |
children | Snippet | - | Content to render inside the indicator (defaults to step number). |
class | string | - | Additional CSS classes to apply. |
Steps.Separator
The visual separator between steps.
| Prop | Type | Default | Description |
|---|---|---|---|
index | number | - | The index of the step this separator follows. |
last | boolean | false | Whether this is the last separator (should be hidden). |
completed | boolean | false | Whether the step this separator follows is completed. |
class | string | - | Additional CSS classes to apply. |
Steps.Content
The content panel for a specific step.
| Prop | Type | Default | Description |
|---|---|---|---|
index | number | - | The index of the step this content belongs to. |
children | Snippet | - | The content to render. |
class | string | - | Additional CSS classes to apply. |
Steps.CompletedContent
Content displayed when all steps are completed.
| Prop | Type | Default | Description |
|---|---|---|---|
children | Snippet | - | The content to render when all steps are complete. |
class | string | - | Additional CSS classes to apply. |
Steps.NextTrigger
A button to navigate to the next step.
| Prop | Type | Default | Description |
|---|---|---|---|
children | Snippet | - | The content of the trigger. |
variant | ButtonVariants['variant'] | "outline" | The button variant. |
size | ButtonVariants['size'] | "sm" | The button size. |
colour | ColourName | "gray" | The colour theme. |
class | string | - | Additional CSS classes to apply. |
Steps.PrevTrigger
A button to navigate to the previous step.
| Prop | Type | Default | Description |
|---|---|---|---|
children | Snippet | - | The content of the trigger. |
variant | ButtonVariants['variant'] | "outline" | The button variant. |
size | ButtonVariants['size'] | "sm" | The button size. |
colour | ColourName | "gray" | The colour theme. |
class | string | - | Additional CSS classes to apply. |