A click- or hover-triggered floating panel, positioned with @floating-ui/react and rendered in a portal with focus management. Composed from Popover, Popover.Trigger, and Popover.Content.
Use Popover when the overlay holds interactive or richer content and should open on click (or hover). For a short, non-interactive hint that opens on hover/focus, use Tooltip instead.
Unlike most @uxf/ui components, this directory has no index.ts — import from the file directly:
import { Popover } from "@uxf/ui/popover/popover";
The content is unstyled (no stylesheet ships with this component); style Popover.Content yourself.
There is no @uxf/form twin.
import { Popover } from "@uxf/ui/popover/popover";
<Popover placement="right-start" trigger="click">
<Popover.Trigger>Trigger</Popover.Trigger>
<Popover.Content>Popover content</Popover.Content>
</Popover>;
Set trigger — without it, the popover has no built-in open interaction. Popover.Content renders null while closed.
Popover (root)| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Required. Expects Popover.Trigger and Popover.Content. |
trigger | "hover" | "click" | — | Interaction that opens the popover. If omitted, neither click nor hover opens it. |
placement | Placement | "bottom" | Preferred side; flip/shift adjust when there is no room. |
Popover.TriggerExtends HTMLAttributes<HTMLElement>.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Required. Trigger content. |
asChild | boolean | false | Render the child element as the anchor (clones it) instead of wrapping it in a <button>. The child must accept a ref and DOM props. |
Popover.ContentExtends HTMLAttributes<HTMLDivElement> — standard <div> attributes (children, className, style, …). It is portaled and wrapped in a non-modal FloatingFocusManager, and carries aria-labelledby / aria-describedby wiring from context.
trigger="click" toggles on click; trigger="hover" opens on hover with a safePolygon bridge into the content.usePopoverContextusePopoverContext is exported for reading the popover state from a descendant of Popover. It throws if called outside a <Popover>.
No stylesheet — the panel ships unstyled. It relies only on being rendered inside a React tree (uses a portal to document.body).