popover
Popover with custom content
Popover with custom content
Загрузка превью…
src/popover/c-popover-7.vue
<!--
Расхождение с апстримом: `IconPlaceholder` заменена инлайновым `<svg>`
(lucide-react v0.545.0 "sparkles") — см. docs/PORTING.md §5.
-->
<script setup lang="ts">
import { Button } from "@/components/ui/button"
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"
</script>
<template>
<div class="flex min-h-[100px] items-center justify-center">
<Popover>
<PopoverTrigger as-child>
<Button variant="outline" class="gap-2">
<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-sparkles"
>
<path
d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"
/>
<path d="M20 2v4" />
<path d="M22 4h-4" />
<circle cx="4" cy="20" r="2" />
</svg>
AI Assistant
</Button>
</PopoverTrigger>
<PopoverContent class="w-80 gap-0 overflow-hidden p-0" align="center">
<div class="bg-primary/5 border-primary/10 border-b p-2">
<div class="text-primary flex items-center gap-2 font-semibold">
<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-sparkles size-4"
>
<path
d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"
/>
<path d="M20 2v4" />
<path d="M22 4h-4" />
<circle cx="4" cy="20" r="2" />
</svg>
<span>Smart Suggestions</span>
</div>
</div>
<div class="space-y-3 p-2">
<p class="text-muted-foreground leading-relaxed">
Our AI analyzes your workflow to provide tailored recommendations. It
helps you automate repetitive tasks and optimizes your design process
in real-time.
</p>
<div class="grid grid-cols-2 items-center gap-2">
<Button size="sm">Enable AI</Button>
<Button size="sm" variant="outline">Learn more</Button>
</div>
</div>
</PopoverContent>
</Popover>
</div>
</template>