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.
Latest changeNewv2.0.0Title, description and close parts: GlassPopoverTitle, GlassPopoverDescription and GlassPopoverClose.
- v2.0.0NewTitle, description and close parts:
GlassPopoverTitle,GlassPopoverDescriptionandGlassPopoverClose. - v2.0.0ImprovedChoose where it opens:
over="center" | "edge"andfrom="top" | "bottom". Its label returns letter by letter as it closes. - v2.0.0FixedThe panel no longer jumps to the top of the window when it opens; it stays centred on its trigger.
- v1.1.0NewPopover: a button that opens into a small glass panel right where it is.
- All changes →
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/reactTrigger ARIA attributes, Escape-to-close, click-outside dismissal and positioning come from UI SDK (@ui-sdk/core and @ui-sdk/react).
Usage
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
| Prop | Type | Default |
|---|---|---|
open / defaultOpen / onOpenChangeOn | boolean / boolean / (open: boolean) => void | — |
GlassPopoverTrigger asChildAttach the trigger props to its single child element instead of rendering a glass button. | boolean | false |
GlassPopoverContent sideWhich side of the trigger the surface unfolds on. Flips automatically if there is no room. | 'top' | 'right' | 'bottom' | 'left' | 'bottom' |
GlassPopoverContent alignAlignment along the chosen side. | 'start' | 'center' | 'end' | 'center' |
GlassPopoverContent sideOffsetGap in px between the trigger and the unfolded glass surface. | number | 10 |
GlassPopoverContent classNameWidth, padding and corners ( | string | — |
GlassPopoverTitle / GlassPopoverDescription / GlassPopoverCloseAccessible heading, supporting copy, and tactile close-on-press action pills inside | ComponentProps | — |
Accessibility
- Trigger carries
aria-expandedandaria-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.