PopoverNew
A small refractive glass surface that unfolds straight out of its trigger button, holding quick controls, pickers or short details without leaving the page.
@vitrumui/react/popover): the button unfolds into a small refractive glass surface 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,
GlassPopoverContent,
GlassPopoverTrigger,
} from '@vitrumui/react/popover'
<GlassPopover>
<GlassPopoverTrigger>Remind me</GlassPopoverTrigger>
<GlassPopoverContent side="bottom" align="center">
<p className="font-semibold">Schedule reminder</p>
<p className="mt-1 text-xs opacity-70">Choose when to be notified.</p>
</GlassPopoverContent>
</GlassPopover>The trigger wears Button's refractive glass; pressing it unfolds the glass body into a frosted panel right beside it, then pulls back into the button on close. Pass open and onOpenChange to control it from your own state, or let it manage itself with defaultOpen.
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 | — |
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.