Glin UI
Primitive / Molecule

Popover

Floating content panel anchored to a trigger element.

Edit on GitHub
Q4 roadmap

Installation

Install from
pnpm dlx @glinui/cli@latest add popover

Prefer 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

KeyAction
EscapeClose the popover.
TabCycle 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

opacitytransform

API Reference

Popover

PropTypeRequiredDefaultDescription
openboolean--Controlled open state.
defaultOpenboolean--Initial open state.
onOpenChange(open: boolean) => void--Open state change handler.
modalboolean-falseTrap focus within the popover.
containerHTMLElement | nullNo-Element to portal into. Defaults to document.body.
size"sm" | "md" | "lg"No"md"Variant option from popoverContentVariants.
variantPanelVariantPropNo-Surface look. Omit for the ambient design style (glinr by default). `glass` is opt-in and needs a rich backdrop.

PopoverTrigger

PropTypeRequiredDefaultDescription
asChildboolean-falseRender as child element.
containerHTMLElement | nullNo-Element to portal into. Defaults to document.body.
size"sm" | "md" | "lg"No"md"Variant option from popoverContentVariants.
variantPanelVariantPropNo-Surface look. Omit for the ambient design style (glinr by default). `glass` is opt-in and needs a rich backdrop.

PopoverContent

PropTypeRequiredDefaultDescription
variantPanelVariantPropNoambient 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"NomdContent width (w-56/w-72/w-80).
align"start" | "center" | "end"-centerAlignment relative to trigger.
sideOffsetnumber-8Distance from trigger in pixels.
side"top" | "right" | "bottom" | "left"-bottomPreferred side of the trigger.
containerHTMLElement | nullNo-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/ui

Generated API Snapshot

Beta

Auto-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

PropTypeRequiredDefaultDescription
containerHTMLElement | nullNo-Element to portal into. Defaults to document.body.
size"sm" | "md" | "lg"No"md"Variant option from popoverContentVariants.
variantPanelVariantPropNo-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

PropTypeRequiredDefaultDescription
size"sm" | "md" | "lg"No"md"Variant option from popoverTriggerVariants.
variant"default" | "glass" | "frosted" | "outline" | "ghost"No"default"Variant option from popoverTriggerVariants.