tooltip
Tooltip with warning badge
Tooltip with warning badge
Загрузка превью…
src/tooltip/c-tooltip-9.vue
<!--
Расхождение с апстримом: `IconPlaceholder` заменена инлайновым `<svg>`
(lucide-react v0.545.0 "triangle-alert") — см. docs/PORTING.md §5.
-->
<script setup lang="ts">
import { Button } from "@/components/ui/button"
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"
</script>
<template>
<div class="flex items-center justify-center">
<TooltipProvider>
<Tooltip>
<TooltipTrigger as-child>
<Button variant="outline" size="icon" aria-label="Warning">
<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="lucide lucide-triangle-alert"
>
<path
d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"
/>
<path d="M12 9v4" />
<path d="M12 17h.01" />
</svg>
</Button>
</TooltipTrigger>
<TooltipContent>
<div class="flex items-center gap-2 text-sm">
<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="lucide lucide-triangle-alert size-4 shrink-0"
>
<path
d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"
/>
<path d="M12 9v4" />
<path d="M12 17h.01" />
</svg>
This action cannot be undone
</div>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
</template>