Search documentation

Search the documentation and open a page.

Displays rich content in a portal, triggered by a button.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/popover

Composition

Popover ├── PopoverAnchor | PopoverTrigger └── PopoverPositioner └── PopoverContent ├── PopoverHeader (optional) │ ├── PopoverTitle │ └── PopoverDescription ├── content ├── PopoverCloseTrigger (optional) └── PopoverArrow (optional)

Examples

Default

Loading...

Filters

Loading...

Notifications

Loading...

Placement

Loading...

With Form

Loading...

API Reference

Popover

PropTypeDefaultDescription
idstring | undefined—Unique identifier used to connect the component parts.
translationsIntlTranslations | undefined—Configures translations.
idsElementIds | undefined—Overrides generated identifiers for individual parts.
modalboolean | undefined—Configures modal.
portalledboolean | undefined—Configures portalled.
autoFocusboolean | undefined—Configures auto focus.
initialFocusEl(() => HTMLElement | null) | undefined—Configures initial focus el.
finalFocusEl(() => MaybeElement) | undefined—Configures final focus el.
restoreFocusboolean | undefined—Configures restore focus.
closeOnInteractOutsideboolean | undefinedtrueConfigures close on interact outside.
closeOnEscapeboolean | undefinedtrueConfigures close on escape.
onOpenChange((details: OpenChangeDetails) => void) | undefined—Runs when open changes.
positioningPositioningOptions | undefined—Configures floating-element placement and collision handling.
openboolean | undefined—Whether the component is open when controlled.
defaultOpenboolean | undefined—Initial open state when uncontrolled.
triggerValuestring | null | undefined—Configures trigger value.
defaultTriggerValuestring | null | undefined—Configures default trigger value.
onTriggerValueChange((details: TriggerValueChangeDetails) => void) | undefined—Runs when trigger value changes.

Context, Hooks, and Types

ExportAPI
PopoverContextRender-prop component that exposes component state and actions.
PopoverRootProviderProvides an externally created API to the component tree.
usePopoverCreates or accesses the component API.
usePopoverContextReturns the nearest component API.
PopoverOpenChangeDetailsType for the details object passed to the matching change callback.