stepper

Stepper with vertical orientation

Stepper with vertical orientation

Загрузка превью…

src/stepper/c-stepper-14.vue

<script setup lang="ts">
import { Stepper, StepperContent, StepperIndicator, StepperItem, StepperNav, StepperPanel, StepperSeparator, StepperTrigger } from "@/components/reui/stepper"

const steps = [1, 2, 3]
</script>

<template>
  <div class="flex items-center justify-center">
    <Stepper
      class="flex flex-col items-center justify-center gap-10"
      :default-value="2"
      orientation="vertical"
    >
      <template #indicator-completed>
        <svg
          xmlns="http://www.w3.org/2000/svg"
          width="24"
          height="24"
          viewBox="0 0 24 24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          class="size-3.5"
        >
          <path d="M20 6 9 17l-5-5" />
        </svg>
      </template>
      <template #indicator-loading>
        <svg
          xmlns="http://www.w3.org/2000/svg"
          width="24"
          height="24"
          viewBox="0 0 24 24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          class="size-3.5 animate-spin"
        >
          <path d="M21 12a9 9 0 1 1-6.219-8.56" />
        </svg>
      </template>

      <StepperNav>
        <StepperItem
          v-for="step in steps"
          :key="step"
          :step="step"
          :loading="step === 2"
        >
          <StepperTrigger>
            <StepperIndicator
              class="data-[state=completed]:bg-success data-[state=completed]:text-white"
            >{{ step }}</StepperIndicator>
          </StepperTrigger>
          <StepperSeparator
            v-if="steps.length > step"
            class="group-data-[state=completed]/step:bg-success"
          />
        </StepperItem>
      </StepperNav>

      <StepperPanel class="w-56 text-center text-sm">
        <StepperContent v-for="step in steps" :key="step" :value="step">Step {{ step }} content</StepperContent>
      </StepperPanel>
    </Stepper>
  </div>
</template>

Установка

npx shadcn-vue@latest add https://revueui.rootapi.dev/r/c-stepper-14.json

Зависимости реестра

Источник: порт из ReUI (Keenthemes, MIT)