1. framework components
  2. ›
  3. steps

Steps

Use steps to guide users through a multi-step process.

First do this.

Controlled

Use the step and onStepChange props to control state programmatically.

First do this.

Orientation

Using the orientation prop to control the layout.

First do this.

Direction

Set the text direction (ltr or rtl) using the dir prop.

First do this.

Anatomy

Here’s an overview of how the Steps component is structured in code:

svelte
<script lang="ts">
	import { Steps } from '@skeletonlabs/skeleton-svelte';
</script>

<Steps>
	<Steps.List>
		<Steps.Item>
			<Steps.Trigger>
				<Steps.Indicator />
			</Steps.Trigger>
			<Steps.Separator />
		</Steps.Item>
	</Steps.List>
	<Steps.Content />
	<Steps.PrevTrigger />
	<Steps.NextTrigger />
</Steps>

API Reference

Root

PropDefaultType
ids—ElementIds | undefined

The custom ids for the stepper elements

step—number | undefined

The controlled value of the stepper

defaultStep—number | undefined

The initial value of the stepper when rendered. Use when you don't need to control the value of the stepper.

onStepChange—((details: StepChangeDetails) => void) | undefined

Callback to be called when the value changes

onStepComplete—VoidFunction | undefined

Callback to be called when a step is completed

linear—boolean | undefined

If `true`, the stepper requires the user to complete the steps in order

orientation"horizontal""horizontal" | "vertical" | undefined

The orientation of the stepper

count—number | undefined

The total number of steps

isStepValid() => true((index: number) => boolean) | undefined

Whether a step is valid. Invalid steps block forward navigation in linear mode.

isStepSkippable() => false((index: number) => boolean) | undefined

Whether a step can be skipped during navigation. Skippable steps are bypassed when using next/prev.

onStepInvalid—((details: StepInvalidDetails) => void) | undefined

Called when navigation is blocked due to an invalid step.

dir"ltr""ltr" | "rtl" | undefined

The document's text/writing direction.

getRootNode—(() => ShadowRoot | Node | Document) | undefined

A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.

element—Snippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Provider

PropDefaultType
value—() => StepsApi<PropTypes>

element—Snippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Context

PropDefaultType
children—Snippet<[() => StepsApi<PropTypes>]>

List

PropDefaultType
element—Snippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Item

PropDefaultType
index—number

element—Snippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Trigger

PropDefaultType
element—Snippet<[HTMLAttributes<"button">]> | undefined

Render the element yourself

Indicator

PropDefaultType
element—Snippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Separator

PropDefaultType
element—Snippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

Content

PropDefaultType
index—number

element—Snippet<[HTMLAttributes<"div">]> | undefined

Render the element yourself

PrevTrigger

PropDefaultType
element—Snippet<[HTMLAttributes<"button">]> | undefined

Render the element yourself

NextTrigger

PropDefaultType
element—Snippet<[HTMLAttributes<"button">]> | undefined

Render the element yourself

View page on GitHub