Skip to content
uiify

Popover

Popover surface anchored to its trigger.

Browsers
Chrome 114+, Firefox 125+, Safari 17+
Tier
0
Bundle compressed
311 B
Forced layout budget
0 ms
Axe budget
0
SSR compatible
Yes
Published contract
Test harness

Playground

Changes saved

This panel stays open until you dismiss it.

Changes saved

This panel stays open until you dismiss it.

import { PopoverClose, PopoverContent, PopoverTrigger } from "@gunkin/uiify";

export default function Example() {
  return (
    <div className="uiify-popover">
      <PopoverTrigger target="actions-popover">Actions</PopoverTrigger>
      <PopoverContent id="actions-popover" mode="auto" side="bottom" align="center">
        <a href="/profile">Profile</a>
        <PopoverClose target="actions-popover">Close</PopoverClose>
      </PopoverContent>
    </div>
  );
}

API

PopoverClose

PropTypeDefaultDescription
childrenReactNode——
targetstring—`id` of the `PopoverContent` this button hides.
commandstring——
commandforstring——
asElementType & ("button" | ComponentType<any>)—`"button"` (default) or a component that forwards props and ref to a native <button>.
rendernever——

PopoverContent

PropTypeDefaultDescription
alignAnchorAlign"center"—
childrenReactNode——
idstring—Unique id supplied by the consumer; referenced by trigger and close `target`.
modePopoverSurfaceMode"auto"—
sideAnchorSide"bottom"—

PopoverTrigger

PropTypeDefaultDescription
childrenReactNode——
targetstring—`id` of the `PopoverContent` this button toggles.
commandstring——
commandforstring——
asElementType & ("button" | ComponentType<any>)—`"button"` (default) or a component that forwards props and ref to a native <button>.
rendernever——

Keyboard

KeyAction
EscapeDismiss
TabMove into the popover content when open

Accessibility

Native Popover API: a popovertarget invoker toggles the surface before any JavaScript runs; the browser owns light dismiss, Escape and nesting, and anchors the surface to the invoker that opened it.

Styling hooks

  • data-side
  • data-align
  • data-positioning
  • --uiify-trigger-openinside .uiify-popover