pnpm dlx @glinui/cli@latest add popoverInstallation
pnpm dlx @glinui/cli@latest add popoverPrefer the package?
Usage
Notifications
A compact list in a popover anchored to an icon button.
"use client"
import { Bell } from "@phosphor-icons/react"import { Button, Popover, PopoverContent, PopoverTrigger} from "@glinui/ui"
export function PopoverNotificationsExample() { const items = [ { title: "Deploy finished", when: "2 min ago" }, { title: "Sara commented on Pricing", when: "1 h ago" }, { title: "Invoice INV-1042 paid", when: "Yesterday" } ] return ( <div className="mx-auto flex w-full max-w-xs justify-center"> <Popover> <PopoverTrigger asChild><Button variant="outline" size="icon" aria-label="Notifications, 3 new"><Bell aria-hidden="true" /></Button></PopoverTrigger> <PopoverContent className="w-72"> <p className="text-sm font-medium">Notifications</p> <ul className="mt-2 grid divide-y divide-[var(--line-soft)]"> {items.map((item) => ( <li key={item.title} className="py-2 text-sm"><p>{item.title}</p><p className="text-xs text-[var(--color-muted)]">{item.when}</p></li> ))} </ul> </PopoverContent> </Popover> </div> )}Variants
Every look of the shared vocabulary: glinr (the default), plain (shadcn), solid, soft, outline, ghost, gradient and glass. Omit `variant` to follow the ambient design style.
import { Button, Popover, PopoverContent, PopoverTrigger } from "@glinui/ui"
const variants = ["glinr", "plain", "solid", "soft", "outline", "ghost", "gradient", "glass"] as const
export function Demo() { return ( <div className="flex flex-wrap gap-2"> {variants.map((variant) => ( <Popover key={variant}> <PopoverTrigger asChild><Button size="sm" variant="outline">{variant}</Button></PopoverTrigger> <PopoverContent variant={variant} size="sm"> <p className="font-medium">{variant} popover</p> <p className="mt-1 text-[var(--color-muted)]">Quick, anchored content.</p> </PopoverContent> </Popover> ))} </div> )}Glass (opt-in)
variant="glass" is opt-in. It blurs and tints what sits behind the panel (with a readable opacity floor), so it needs a colourful or photographic backdrop: switch the stage backdrop to see it.
import { Button, Popover, PopoverContent, PopoverTrigger } from "@glinui/ui"
export function Demo() { return ( <Popover> <PopoverTrigger asChild><Button variant="outline">Open glass popover</Button></PopoverTrigger> <PopoverContent variant="glass">Frosted, with a readable floor.</PopoverContent> </Popover> )}Glass
import { Popover, PopoverTrigger, PopoverContent } from "@glinui/ui"
export function PopoverGlassDemo() {
return (
<Popover>
<PopoverTrigger variant="glass">Filter</PopoverTrigger>
<PopoverContent variant="glass" className="space-y-2">
<p className="text-sm">Filter options</p>
</PopoverContent>
</Popover>
)
}Accessibility
- Built on Radix Popover with focus management.
- Focus returns to trigger on close.
- Keep popover content concise and task-focused.
Keyboard Interactions
| Key | Action |
|---|---|
| Escape | Close the popover. |
| Tab | Cycle focus within the popover. |
ARIA Attributes
- `aria-expanded` on trigger
- `aria-controls` linking trigger to content
Reduced Motion
Open/close transitions respect `prefers-reduced-motion`.
Popover remains functional and readable with reduced motion settings.
Affected properties
opacitytransformAPI Reference
Popover
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
open | boolean | - | - | Controlled open state. |
defaultOpen | boolean | - | - | Initial open state. |
onOpenChange | (open: boolean) => void | - | - | Open state change handler. |
modal | boolean | - | false | Trap focus within the popover. |
container | HTMLElement | null | No | - | Element to portal into. Defaults to document.body. |
size | "sm" | "md" | "lg" | No | "md" | Variant option from popoverContentVariants. |
variant | PanelVariantProp | No | - | Surface look. Omit for the ambient design style (glinr by default). `glass` is opt-in and needs a rich backdrop. |
PopoverTrigger
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
asChild | boolean | - | false | Render as child element. |
container | HTMLElement | null | No | - | Element to portal into. Defaults to document.body. |
size | "sm" | "md" | "lg" | No | "md" | Variant option from popoverContentVariants. |
variant | PanelVariantProp | No | - | Surface look. Omit for the ambient design style (glinr by default). `glass` is opt-in and needs a rich backdrop. |
PopoverContent
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
variant | PanelVariantProp | No | ambient style (glinr) | Panel look. Omit it for the ambient design style (glinr shell with a gradient hairline ring, elev-3). `plain` is the shadcn border and shadow, `solid` and `soft` are tonal, `glass` is opt-in and needs a backdrop. Legacy `default` follows the ambient style, `frosted` maps to `glass`, `matte` to `solid`. |
size | "sm" | "md" | "lg" | No | md | Content width (w-56/w-72/w-80). |
align | "start" | "center" | "end" | - | center | Alignment relative to trigger. |
sideOffset | number | - | 8 | Distance from trigger in pixels. |
side | "top" | "right" | "bottom" | "left" | - | bottom | Preferred side of the trigger. |
container | HTMLElement | null | No | - | Element to portal into. Defaults to document.body. |
Source
Import directly from the package or browse the source on GitHub. Click any file to view it.
Import
import { Popover } from "@glinui/ui"Source Files
Dependencies
@glinui/uiGenerated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/popover.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata
Primary Props Type
PopoverProps
PopoverContentProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
container | HTMLElement | null | No | - | Element to portal into. Defaults to document.body. |
size | "sm" | "md" | "lg" | No | "md" | Variant option from popoverContentVariants. |
variant | PanelVariantProp | No | - | Surface look. Omit for the ambient design style (glinr by default). `glass` is opt-in and needs a rich backdrop. |
PopoverProps
No explicit fields extracted for this props type.
PopoverTriggerProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
size | "sm" | "md" | "lg" | No | "md" | Variant option from popoverTriggerVariants. |
variant | "default" | "glass" | "frosted" | "outline" | "ghost" | No | "default" | Variant option from popoverTriggerVariants. |