checkbox

Checkbox with label and tooltip info

Checkbox with label and tooltip info

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

src/checkbox/c-checkbox-20.vue

<!--
  Расхождение с апстримом: `IconPlaceholder` заменена инлайновым `<svg>`
  (lucide-react v0.545.0 "circle-question-mark", он же "help-circle") —
  см. docs/PORTING.md §5.
-->
<script setup lang="ts">
import { Checkbox } from "@/components/ui/checkbox"
import { Field, FieldLabel } from "@/components/ui/field"
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"
</script>

<template>
  <Field orientation="horizontal" class="w-auto">
    <Checkbox id="tooltip-checkbox" />

    <div class="flex items-center gap-1.5">
      <FieldLabel for="tooltip-checkbox">Enable advanced analytics</FieldLabel>
      <TooltipProvider>
        <Tooltip>
          <TooltipTrigger class="text-muted-foreground">
            <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"
              aria-hidden="true"
              class="lucide lucide-circle-question-mark size-3.5"
            >
              <circle cx="12" cy="12" r="10" />
              <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" />
              <path d="M12 17h.01" />
            </svg>
          </TooltipTrigger>
          <TooltipContent side="right">
            Advanced analytics provides deeper insights into user behavior and system
            performance.
          </TooltipContent>
        </Tooltip>
      </TooltipProvider>
    </div>
  </Field>
</template>

Установка

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

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

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