Stepper
A multi-step progress indicator on light rails: each completed step sends a single sweep of light down the rail to the next, the current bullet breathes a soft halo, and each check draws itself.
Available for Svelte 5, React, and Vue 3.
Preview
<script lang="ts">
import { Stepper, Step } from "fancy-ui-svelte";
const steps = [
{ label: "Account", description: "Sign-in details" },
{ label: "Workspace", description: "Name and region" },
{ label: "Invite", description: "Bring your team" },
{ label: "Launch", description: "Review and go" },
];
let current = $state(2);
</script>
<div
class="w-full max-w-2xl rounded-[22px] border border-black/[0.08] bg-[#f4f4f5] p-1.5 dark:border-white/[0.08] dark:bg-[#0b0b0c]"
>
<div
class="rounded-2xl border border-black/[0.08] bg-[#fafafa] shadow-[0_1px_2px_rgb(0_0_0/0.04)] dark:border-white/[0.06] dark:bg-[#141416] dark:shadow-none"
>
<div
class="flex items-center justify-between border-b border-black/[0.06] px-5 py-3 dark:border-white/[0.06]"
>
<span class="text-foreground text-[13px] font-medium">New workspace</span>
<span class="text-muted-foreground font-mono text-[11px] tabular-nums">
{String(current + 1).padStart(2, "0")} / {String(steps.length).padStart(2, "0")}
</span>
</div>
<div class="px-4 pt-7 pb-6 sm:px-6">
<Stepper bind:current>
{#each steps as step (step.label)}
<Step label={step.label} description={step.description} />
{/each}
</Stepper>
</div>
<div
class="flex items-center justify-between border-t border-black/[0.06] px-5 py-3 dark:border-white/[0.06]"
>
<button
type="button"
class="text-muted-foreground hover:text-foreground rounded-md px-2.5 py-1.5 text-[13px] transition-colors disabled:pointer-events-none disabled:opacity-40"
disabled={current === 0}
onclick={() => (current = Math.max(0, current - 1))}
>
Back
</button>
<button
type="button"
class="rounded-lg border border-black/[0.08] bg-white px-3.5 py-1.5 text-[13px] font-medium text-neutral-900 shadow-[0_1px_2px_rgb(0_0_0/0.06)] transition-colors hover:bg-neutral-50 dark:border-white/[0.1] dark:bg-white/[0.06] dark:text-neutral-100 dark:shadow-none dark:hover:bg-white/[0.1]"
onclick={() => (current = current === steps.length - 1 ? 0 : current + 1)}
>
{current === steps.length - 1 ? "Start over" : "Continue"}
</button>
</div>
</div>
</div>Installation
Usage
<script lang="ts">
import { Stepper, Step } from "fancy-ui-svelte";
const steps = [
{ label: "Account", description: "Sign-in details" },
{ label: "Workspace", description: "Name and region" },
{ label: "Invite", description: "Bring your team" },
{ label: "Launch", description: "Review and go" },
];
let current = $state(2);
</script>
<div
class="w-full max-w-2xl rounded-[22px] border border-black/[0.08] bg-[#f4f4f5] p-1.5 dark:border-white/[0.08] dark:bg-[#0b0b0c]"
>
<div
class="rounded-2xl border border-black/[0.08] bg-[#fafafa] shadow-[0_1px_2px_rgb(0_0_0/0.04)] dark:border-white/[0.06] dark:bg-[#141416] dark:shadow-none"
>
<div
class="flex items-center justify-between border-b border-black/[0.06] px-5 py-3 dark:border-white/[0.06]"
>
<span class="text-foreground text-[13px] font-medium">New workspace</span>
<span class="text-muted-foreground font-mono text-[11px] tabular-nums">
{String(current + 1).padStart(2, "0")} / {String(steps.length).padStart(2, "0")}
</span>
</div>
<div class="px-4 pt-7 pb-6 sm:px-6">
<Stepper bind:current>
{#each steps as step (step.label)}
<Step label={step.label} description={step.description} />
{/each}
</Stepper>
</div>
<div
class="flex items-center justify-between border-t border-black/[0.06] px-5 py-3 dark:border-white/[0.06]"
>
<button
type="button"
class="text-muted-foreground hover:text-foreground rounded-md px-2.5 py-1.5 text-[13px] transition-colors disabled:pointer-events-none disabled:opacity-40"
disabled={current === 0}
onclick={() => (current = Math.max(0, current - 1))}
>
Back
</button>
<button
type="button"
class="rounded-lg border border-black/[0.08] bg-white px-3.5 py-1.5 text-[13px] font-medium text-neutral-900 shadow-[0_1px_2px_rgb(0_0_0/0.06)] transition-colors hover:bg-neutral-50 dark:border-white/[0.1] dark:bg-white/[0.06] dark:text-neutral-100 dark:shadow-none dark:hover:bg-white/[0.1]"
onclick={() => (current = current === steps.length - 1 ? 0 : current + 1)}
>
{current === steps.length - 1 ? "Start over" : "Continue"}
</button>
</div>
</div>
</div>Examples
Basic Usage
A four-step wizard in a nested frame; Continue and Back run the light along the rails.
<script lang="ts">
import { Stepper, Step } from "$lib/fancy-ui/stepper";
const steps = [
{ label: "Account", description: "Sign-in details" },
{ label: "Workspace", description: "Name and region" },
{ label: "Invite", description: "Bring your team" },
{ label: "Launch", description: "Review and go" },
];
let current = $state(2);
</script>
<div
class="w-full max-w-2xl rounded-[22px] border border-black/[0.08] bg-[#f4f4f5] p-1.5 dark:border-white/[0.08] dark:bg-[#0b0b0c]"
>
<div
class="rounded-2xl border border-black/[0.08] bg-[#fafafa] shadow-[0_1px_2px_rgb(0_0_0/0.04)] dark:border-white/[0.06] dark:bg-[#141416] dark:shadow-none"
>
<div
class="flex items-center justify-between border-b border-black/[0.06] px-5 py-3 dark:border-white/[0.06]"
>
<span class="text-foreground text-[13px] font-medium">New workspace</span>
<span class="text-muted-foreground font-mono text-[11px] tabular-nums">
{String(current + 1).padStart(2, "0")} / {String(steps.length).padStart(2, "0")}
</span>
</div>
<div class="px-4 pt-7 pb-6 sm:px-6">
<Stepper bind:current>
{#each steps as step (step.label)}
<Step label={step.label} description={step.description} />
{/each}
</Stepper>
</div>
<div
class="flex items-center justify-between border-t border-black/[0.06] px-5 py-3 dark:border-white/[0.06]"
>
<button
type="button"
class="text-muted-foreground hover:text-foreground rounded-md px-2.5 py-1.5 text-[13px] transition-colors disabled:pointer-events-none disabled:opacity-40"
disabled={current === 0}
onclick={() => (current = Math.max(0, current - 1))}
>
Back
</button>
<button
type="button"
class="rounded-lg border border-black/[0.08] bg-white px-3.5 py-1.5 text-[13px] font-medium text-neutral-900 shadow-[0_1px_2px_rgb(0_0_0/0.06)] transition-colors hover:bg-neutral-50 dark:border-white/[0.1] dark:bg-white/[0.06] dark:text-neutral-100 dark:shadow-none dark:hover:bg-white/[0.1]"
onclick={() => (current = current === steps.length - 1 ? 0 : current + 1)}
>
{current === steps.length - 1 ? "Start over" : "Continue"}
</button>
</div>
</div>
</div>Vertical Stepper
Stacked in a column; the rails fill top to bottom.
<script lang="ts">
import { Stepper, Step } from "$lib/fancy-ui/stepper";
let current = $state(2);
</script>
<div
class="w-full max-w-xs rounded-[20px] border border-black/[0.08] bg-[#f4f4f5] p-1.5 dark:border-white/[0.08] dark:bg-[#0b0b0c]"
>
<div
class="rounded-[14px] border border-black/[0.08] bg-[#fafafa] p-5 dark:border-white/[0.06] dark:bg-[#141416]"
>
<Stepper bind:current orientation="vertical">
<Step label="Account" />
<Step label="Profile" />
<Step label="Billing" />
<Step label="Confirmation" />
</Stepper>
</div>
</div>Clickable Steps
Jump to any step; a jump across several steps lights the rails one after another.
<script lang="ts">
import { Stepper, Step } from "$lib/fancy-ui/stepper";
let current = $state(0);
let lastClicked = $state<number | null>(null);
function onStepClick(index: number) {
lastClicked = index;
}
</script>
<div
class="w-full max-w-xl rounded-[20px] border border-black/[0.08] bg-[#f4f4f5] p-1.5 dark:border-white/[0.08] dark:bg-[#0b0b0c]"
>
<div
class="rounded-[14px] border border-black/[0.08] bg-[#fafafa] px-4 pt-6 pb-4 sm:px-6 dark:border-white/[0.06] dark:bg-[#141416]"
>
<Stepper sound bind:current clickable {onStepClick}>
<Step label="Account" />
<Step label="Profile" />
<Step label="Billing" />
<Step label="Confirmation" />
</Stepper>
<p class="text-muted-foreground mt-5 text-center text-xs" aria-live="polite">
{#if lastClicked !== null}
Jumped to step {lastClicked + 1}.
{:else}
Click the last step to send light down every rail.
{/if}
</p>
</div>
</div>With Descriptions
Vertical, clickable, with a secondary line under each label.
<script lang="ts">
import { Stepper, Step } from "$lib/fancy-ui/stepper";
let current = $state(1);
</script>
<div
class="w-full max-w-sm rounded-[20px] border border-black/[0.08] bg-[#f4f4f5] p-1.5 dark:border-white/[0.08] dark:bg-[#0b0b0c]"
>
<div
class="rounded-[14px] border border-black/[0.08] bg-[#fafafa] p-5 dark:border-white/[0.06] dark:bg-[#141416]"
>
<Stepper bind:current orientation="vertical" clickable>
<Step label="Account" description="Create your login" />
<Step label="Profile" description="Tell us about yourself" />
<Step label="Billing" description="Pick a plan" />
<Step label="Confirmation" description="Review and finish" />
</Stepper>
</div>
</div>Props
| Prop | Type | Default | Description |
|---|---|---|---|
current | number | 0 | The active step's 0-based index. Bindable. |
onCurrentChange | (current: number) => void | - | Called with the new index whenever it changes, however the change happened. |
orientation | "horizontal" | "vertical" | "horizontal" | The rail's stacking axis. |
clickable | boolean | false | Whether steps render as buttons a reader can click to jump between them. |
onStepClick | (index: number) => void | - | Called with a step's index when it's activated by a click. Only fires when clickable. |
class | string | - | Additional CSS classes, merged onto the root. |
ref | HTMLOListElement | null | null | Bindable reference to the root element. |
sound | boolean | false | Plays select when a clickable step changes the current step, once the user has enabled sound |
Step.label * | string | - | The step's primary label. |
Step.description | string | - | Optional secondary line shown under the label. |
Step.class | string | - | Additional CSS classes, merged onto the step's li. |
Step.ref | HTMLLIElement | null | null | Bindable reference to the step's li element. |
Slots
| Slot | Description |
|---|---|
children | The Steps. |
Step.children | Overrides the bullet's default content (checkmark / number / outline). |
Links
Related components
Accordion
A stack of headed sections where one or several open at a time, with a collapse that animates without measuring, arrow-key navigation between headers and labelled regions for assistive tech.
Breadcrumb
A data-driven trail of links with automatic truncation, a decorative separator, and the current page marked for assistive tech.
Collapsible
A single disclosure: a trigger that expands and collapses a region, animated without measuring so an interrupted toggle simply reverses, with the closed content kept in the page.