UI Components
Popover
An anchor-aware floating popover with auto-positioning, sub-components, and keyboard/click-outside dismissal.
Quick Preview
Installation
// Copy Popover.tsx to your components/ui/ folder// src/components/ui/Popover.tsx
Usage
import { Popover, PopoverContent, PopoverHeader, PopoverFooter } from '@/components/ui/Popover'<Popover trigger={<button>Open</button>}><PopoverHeader><p>Title</p></PopoverHeader><PopoverContent><p>Your content here</p></PopoverContent></Popover>
Examples
Positioning
Rich Content Popover
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
trigger* | React.ReactNode | - | Element that opens the popover on click |
children* | React.ReactNode | - | Popover content |
side | "top" | "bottom" | "left" | "right" | "bottom" | Preferred side to place the popover |
align | "start" | "center" | "end" | "start" | Alignment relative to the trigger |
sideOffset | number | 8 | Gap (px) between trigger and popover |
open | boolean | - | Controlled open state |
onOpenChange | (open: boolean) => void | - | Called when the open state changes |