Steps
An ordered step list component for setup guides and workflow documentation.
Overview
Steps renders ordered instructions with consistent spacing and automatic numbering. It works well for setup guides and onboarding.
Example
-
Install Dependencies
-
Start the Dev Server
-
Begin Editing Content
Install the project dependencies before starting the app.
Launch the local site and confirm the documentation is loading.
Add or update markdown files inside the content directory.
Markdown Usage
Import the Steps and Step components into the markdown, then pass a title prop and the Step content as children:
import { Steps, Step } from '$ui/steps';
<Steps>
<Step title="Install Dependencies">
Install the project dependencies before starting the app.
</Step>
<Step title="Start the Dev Server">
Launch the local site and confirm the documentation is loading.
</Step>
<Step title="Begin Editing Content">
Add or update markdown files inside the content directory.
</Step>
</Steps> .md
Starting at a Different Number
Use the start prop to start the first step at a specific number.
import { Steps, Step } from '$ui/steps';
<Steps start={4}>
<Step title="Install Dependencies">
Install the project dependencies before starting the app.
</Step>
<Step title="Start the Dev Server">
Launch the local site and confirm the documentation is loading.
</Step>
<Step title="Begin Editing Content">
Add or update markdown files inside the content directory.
</Step>
</Steps> .md
-
Install Dependencies
-
Start the Dev Server
-
Begin Editing Content
Install the project dependencies before starting the app.
Launch the local site and confirm the documentation is loading.
Add or update markdown files inside the content directory.
Display in Table Of Contents
You can show each step as a header in the table of contents by adding a unique id to each step. The step titles are h6 heading elements, so they will always have the highest padding in the table of contents.
import { Steps, Step } from '$ui/steps';
<Steps>
<Step id="install-dependencies" title="Install Dependencies">
Install the project dependencies before starting the app.
</Step>
<Step id="start-dev-server" title="Start the Dev Server">
Launch the local site and confirm the documentation is loading.
</Step>
<Step id="edit-content" title="Begin Editing Content">
Add or update markdown files inside the content directory.
</Step>
</Steps> .md
-
Install Dependencies
-
Start the Dev Server
-
Begin Editing Content
Install the project dependencies before starting the app.
Launch the local site and confirm the documentation is loading.
Add or update markdown files inside the content directory.
Editing the Component
Steps lives in src/lib/components/ui/steps.