Skip to content

Components

Popover

A small refractive glass surface that unfolds straight out of its trigger button, holding quick controls, pickers or short details without leaving the page.

Markdown
Latest changeNewv2.0.0Title, description and close parts: GlassPopoverTitle, GlassPopoverDescription and GlassPopoverClose.
  1. v2.0.0NewTitle, description and close parts: GlassPopoverTitle, GlassPopoverDescription and GlassPopoverClose.
  2. v2.0.0ImprovedChoose where it opens: over="center" | "edge" and from="top" | "bottom". Its label returns letter by letter as it closes.
  3. v2.0.0FixedThe panel no longer jumps to the top of the window when it opens; it stays centred on its trigger.
  4. v1.1.0NewPopover: a button that opens into a small glass panel right where it is.
  5. All changes →
glass-popover-basic.tsx

Use it for

  • A compact picker, reminder scheduler, filter panel or detail card anchored to one button.
  • Rich interactive content that does not fit a list of menu actions.

Not for

  • A list of commands with keyboard arrow navigation: use Menu or Dropdown Menu.
  • Full-screen forms or blocking confirmations: use a dialog.

Installation

npm install @vitrumui/react
Peer: React 19

Trigger ARIA attributes, Escape-to-close, click-outside dismissal and positioning come from UI SDK (@ui-sdk/core and @ui-sdk/react).

Usage

app.tsx
import {
  GlassPopover,
  GlassPopoverClose,
  GlassPopoverContent,
  GlassPopoverDescription,
  GlassPopoverTitle,
  GlassPopoverTrigger,
} from '@vitrumui/react/popover'

<GlassPopover>
  <GlassPopoverTrigger>Remind me</GlassPopoverTrigger>
  <GlassPopoverContent>
    <GlassPopoverTitle>Remind me</GlassPopoverTitle>
    <GlassPopoverDescription>
      We will send one notification, then leave you alone.
    </GlassPopoverDescription>
    <GlassPopoverClose>In an hour</GlassPopoverClose>
  </GlassPopoverContent>
</GlassPopover>

The trigger wears Button's refractive glass; pressing it unfolds (mode="unfold") the glass body directly into a frosted panel centered over the button, then pulls back into the button on close. Use GlassPopoverTitle, GlassPopoverDescription, and GlassPopoverClose for accessible dialog structure.

API reference

PropTypeDefault
open / defaultOpen / onOpenChange

On GlassPopover: control open state yourself, or let it keep its own state.

boolean / boolean / (open: boolean) => void—
GlassPopoverTrigger asChild

Attach the trigger props to its single child element instead of rendering a glass button.

booleanfalse
GlassPopoverContent side

Which side of the trigger the surface unfolds on. Flips automatically if there is no room.

'top' | 'right' | 'bottom' | 'left''bottom'
GlassPopoverContent align

Alignment along the chosen side.

'start' | 'center' | 'end''center'
GlassPopoverContent sideOffset

Gap in px between the trigger and the unfolded glass surface.

number10
GlassPopoverContent className

Width, padding and corners (rounded-*). The glass surface matches the content box.

string—
GlassPopoverTitle / GlassPopoverDescription / GlassPopoverClose

Accessible heading, supporting copy, and tactile close-on-press action pills inside GlassPopoverContent.

ComponentProps—

Accessibility

  • Trigger carries aria-expanded and aria-haspopup="dialog" automatically.
  • Pressing Escape or clicking outside closes the popover and returns focus to the trigger.
  • With reduced motion it opens and closes immediately. Without WebGL2 it renders as a plain frosted panel.