Skip to content

Components

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.

Markdown
Latest changeNewv1.0.0Added GlassPopover (@vitrumui/react/popover): the button unfolds into a small refractive glass surface right where it is.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
No dependencies

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

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—

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.