Zephora UI

Overlay

Popover

Non-modal floating panel anchored to a trigger element. Focus moves into the panel on open and returns to the trigger on close; twelve placements are supported.

Import

import { Popover } from "@zephora/react";

Examples

Basic popover

The trigger element is cloned with toggle behavior and ARIA wiring.

Placement and arrow

`placement` picks the preferred side; `showArrow` points at the trigger.

Controlled

Drive the open state yourself with `open` and `onOpenChange`.

API

Popover props

PropTypeDefaultDescription
trigger *ReactElementElement that anchors and toggles the popover. Cloned with a ref, onClick toggle, aria-haspopup and aria-expanded.
openbooleanControlled open state.
defaultOpenbooleanfalseInitial open state (uncontrolled).
onOpenChange(open: boolean) => voidCalled whenever the popover requests an open state change.
placementPlacement ("top" | "bottom" | "left" | "right" + "-start"/"-end" variants)"bottom"Preferred panel position relative to the trigger.
showArrowbooleanfalseRenders a small arrow pointing at the trigger. The panel and arrow expose the resolved side via data-side (and the full data-placement) attributes for CSS targeting.
closeOnBlurbooleantrueClose when focus or an outside press leaves the popover.
classNamesPartial<Record<"root" | "arrow", string>>Per-slot class overrides: root targets the floating panel (alongside className), arrow the arrow element. Applied after module classes and also in unstyled mode.
unstyledbooleanfalseHeadless mode — skips Zephora styling.

Keyboard

KeyAction
Enter / SpaceOn the trigger: toggles the popover.
EscapeCloses the popover and returns focus to the trigger.
TabMoves focus; leaving the panel closes it when closeOnBlur is on.