Tab stepper
A horizontal stepper component that visually guides users through multi-step processes using labeled tabs.
Component
Description one
Description two
Description three
Props
| Props | Default | Type |
|---|---|---|
modelValue | 1 | number |
steps | An example array | TabStep[]> |
type | StepIndicatorType.NUMBER | StepIndicatorType |
size | StepIndicator.XL | StepIndicator |
completedIcon | mdi:check | string |
isInteractive | false | boolean |
hasDivider | true | boolean |
justifySteps | false | boolean |
isFullWidth | true | boolean |
Usage
modelValue
Sets the current step. The steps starts always with the value 1 by default.
<template>
<TabStepper v-model="currentStep" />
</template>
<script setup lang="ts">
const currentStep = ref(1)
</script>
steps
Sets the steps. The steps are an array of objects which uses the TabStep interface.
<template>
<TabStepper :steps="steps" />
</template>
<script setup lang="ts">
const steps: TabStep[] = [
{
title: "Step 1",
description: "Description one",
},
{
title: "Step 2",
description: "Description two",
},
{
title: "Step 3",
description: "Description three",
},
]
</script>
TypeScript interface
interface TabStep {
title: string
description?: string
icon?: string
}
The icon property is usefull when the type is ICON. Otherwise, it is ignored even if it passed in the array.
type
Sets the type of the step indicators. Uses the StepIndicatorType enum.
<template>
<TabStepper :type="StepIndicatorType.NUMBER" />
</template>
Options
| Value | Description |
|---|---|
NUMBER | Uses numbered steps |
EMPTY | Shows an empty space in the step indicator |
ICON | Displays a custom icon in the step indicator (except if the step is completed). |
completedIcon
Sets the icon to be displayed when the step is completed.
<template>
<TabStepper completedIcon="mdi:check" />
</template>
isInteractive
Sets if the step indicator is interactive. If it is, the user can click on the step to go to the step. As a result, it will also update the ref asigned to the v-model.
In case of having the value false, nothing will happen.
<template>
<TabStepper :isInteractive="false" />
</template>
hasDivider
Sets if the chevron divider is displayed, which will be shown between the steps.
<template>
<TabStepper hasDivider />
</template>
justifySteps
Justify the spacing between the steps in order to distribute the items along the available space.
<template>
<TabStepper :justifySteps="false" />
</template>
isFullWidth
Sets if the component will be displayed as a full width component. It will take the full width of the parent element. Otherwise, it will fit to the content.
<template>
<TabStepper :isFullWidth="true" />
</template>