switch

Switch with description.

Switch with description.

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

src/switch/c-switch-2.vue

<script setup lang="ts">
import { Field, FieldContent, FieldDescription, FieldLabel, FieldTitle } from "@/components/ui/field"
import { Switch } from "@/components/ui/switch"
</script>

<template>
  <div class="flex items-center justify-center">
    <FieldLabel for="switch-with-desc" class="w-full max-w-xs">
      <Field orientation="horizontal">
        <FieldContent>
          <FieldTitle>Share across devices</FieldTitle>
          <FieldDescription>
            Focus is shared across devices, and turns off when you leave the
            app.
          </FieldDescription>
        </FieldContent>
        <Switch id="switch-with-desc" />
      </Field>
    </FieldLabel>
  </div>
</template>

Установка

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

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

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