Steps
Steps can be used to show a list of steps in a process.
Usage
import { Steps } from 'stwui';
import Steps from 'stwui/steps';
<script lang="ts">
import { Steps } from 'stwui';
let currentStep = 2;
const steps = [
{
href: '#step1',
title: 'Step 1',
description: 'Job details'
},
{
href: '#step2',
title: 'Step 2',
description: 'Application form'
},
{
href: '#step3',
title: 'Step 3',
description: 'Preview'
}
];
</script>
<Steps {currentStep}>
{#each steps as step, i}
<Steps.Step step={i + 1} href={step.href} on:click={() => (currentStep = i + 1)}>
<Steps.Step.Title slot="title">{step.title}</Steps.Step.Title>
<Steps.Step.Description slot="description">{step.description}</Steps.Step.Description>
</Steps.Step>
{/each}
</Steps>
<script lang="ts">
import { Steps } from 'stwui';
let currentStep = 2;
const steps = [
{
href: '#step1',
title: 'Step 1',
description: 'Job details'
},
{
href: '#step2',
title: 'Step 2',
description: 'Application form'
},
{
href: '#step3',
title: 'Step 3',
description: 'Preview'
}
];
</script>
<Steps variant="bullets" {currentStep}>
<Steps.Summary slot="summary">Step {currentStep} of {steps.length}</Steps.Summary>
{#each steps as step, i}
<Steps.Step step={i + 1} href={step.href} on:click={() => (currentStep = i + 1)}>
<Steps.Step.Title slot="title">{step.title}</Steps.Step.Title>
</Steps.Step>
{/each}
</Steps>
Bullets & Text
<script lang="ts">
import { Steps } from 'stwui';
let currentStep = 2;
const steps = [
{
href: '#step1',
title: 'Step 1',
description: 'Job details'
},
{
href: '#step2',
title: 'Step 2',
description: 'Application form'
},
{
href: '#step3',
title: 'Step 3',
description: 'Preview'
}
];
</script>
<Steps variant="bullets-text" {currentStep}>
{#each steps as step, i}
<Steps.Step step={i + 1} href={step.href} on:click={() => (currentStep = i + 1)}>
<Steps.Step.Title slot="title">{step.title}</Steps.Step.Title>
</Steps.Step>
{/each}
</Steps>
Circles & Text
<script lang="ts">
import { Steps } from 'stwui';
let currentStep = 2;
const steps = [
{
href: '#step1',
title: 'Step 1',
description: 'Job details'
},
{
href: '#step2',
title: 'Step 2',
description: 'Application form'
},
{
href: '#step3',
title: 'Step 3',
description: 'Preview'
}
];
</script>
<Steps variant="circles-text" {currentStep}>
{#each steps as step, i}
<Steps.Step step={i + 1} href={step.href} on:click={() => (currentStep = i + 1)}>
<Steps.Step.Title slot="title">{step.title}</Steps.Step.Title>
<Steps.Step.Description slot="description">{step.description}</Steps.Step.Description>
</Steps.Step>
{/each}
</Steps>
Steps Props
variant | 'simple' | 'bullets' | 'bullets-text' | 'circles-text' | info |
currentStep | number | |
Steps Slots
summary | <Steps.Summary slot="summary" /> |
default | <Steps.Step /> |
Steps.Step Slots
title | <Steps.Step.Title slot="title" /> |
description | <Steps.Step.Description slot="description" /> |
Steps.Step.Description Slots
Steps Class Identifiers
stwui-steps-simple-wrapper |
stwui-steps-bullets-wrapper |
stwui-steps-bullets-text-wrapper |
stwui-steps-circles-text-wrapper |
stwui-steps-step-bullet-previous |
stwui-steps-step-bullet-current |
stwui-steps-step-bullet-next |
stwui-steps-step-simple-previous |
stwui-steps-step-simple-current |
stwui-steps-step-simple-next |
stwui-steps-summary |
stwui-steps-step-bullets-title-previous |
stwui-steps-step-bullets-title-current |
stwui-steps-step-bullets-title-next |
stwui-steps-step-simple-title-previous |
stwui-steps-step-simple-title-current |
stwui-steps-step-simple-title-next |
stwui-steps-step-circles-title-previous |
stwui-steps-step-circles-title-current |
stwui-steps-step-circles-title-next |
stwui-steps-step-circle-description |
stwui-steps-step-simple-description |
stwui-steps-step-simple-previous-description |