1. framework components
  2. popover

Popover

Small overlay panels positioned relative to a trigger.

Arrow

Visually connects the popover content to the trigger element. Will automatically align based on the selected side.

Z-Index

This component is headless by default. If you find the popover content is being clipped, try increasing the z-index on the Positioner part. In some rare cases you may need to use !important to override library defaults.

Sibling (10)

Provider Pattern

You can programmatically open and close the popover using the Provider Pattern . This is useful for custom interactions and keyboard handling strategies.

Direction

Headless

API Reference

Root

PropDefaultType
childrenReactNode

autoFocustrueboolean | undefined

Whether to automatically set focus on the first focusable content within the popover when opened.

dir"ltr""ltr" | "rtl" | undefined

The document's text/writing direction.

idsPartial<{ anchor: string; trigger: string; content: string; title: string; description: string; closeTrigger: string; positioner: string; arrow: string; }> | undefined

The ids of the elements in the popover. Useful for composition.

modalfalseboolean | undefined

Whether the popover should be modal. When set to `true`: - interaction with outside elements will be disabled - only popover content will be visible to screen readers - scrolling is blocked - focus is trapped within the popover

portalledtrueboolean | undefined

Whether the popover is portalled. This will proxy the tabbing behavior regardless of the DOM position of the popover content.

initialFocusEl(() => HTMLElement | null) | undefined

The element to focus on when the popover is opened.

closeOnInteractOutsidetrueboolean | undefined

Whether to close the popover when the user clicks outside of the popover.

closeOnEscapetrueboolean | undefined

Whether to close the popover when the escape key is pressed.

onOpenChange((details: OpenChangeDetails) => void) | undefined

Function invoked when the popover opens or closes

positioningPositioningOptions | undefined

The user provided options used to position the popover content

openboolean | undefined

The controlled open state of the popover

defaultOpenboolean | undefined

The initial open state of the popover when rendered. Use when you don't need to control the open state of the popover.

getRootNode(() => Node | ShadowRoot | Document) | undefined

A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.

onEscapeKeyDown((event: KeyboardEvent) => void) | undefined

Function called when the escape key is pressed

onRequestDismiss((event: LayerDismissEvent) => void) | undefined

Function called when this layer is closed due to a parent layer being closed

onPointerDownOutside((event: PointerDownOutsideEvent) => void) | undefined

Function called when the pointer is pressed down outside the component

onFocusOutside((event: FocusOutsideEvent) => void) | undefined

Function called when the focus is moved outside the component

onInteractOutside((event: InteractOutsideEvent) => void) | undefined

Function called when an interaction happens outside the component

persistentElements(() => Element | null)[] | undefined

Returns the persistent elements that: - should not have pointer-events disabled - should not trigger the dismiss event

Provider

PropDefaultType
valuePopoverApi<PropTypes>

childrenReactNode

Context

PropDefaultType
children(popover: PopoverApi<PropTypes>) => ReactNode

Trigger

PropDefaultType
childrenReactNode

element((attributes: HTMLAttributes<"button">) => Element) | undefined

Render the element yourself

Positioner

PropDefaultType
element((attributes: HTMLAttributes<"div">) => Element) | undefined

Render the element yourself

Content

PropDefaultType
element((attributes: HTMLAttributes<"div">) => Element) | undefined

Render the element yourself

Arrow

PropDefaultType
element((attributes: HTMLAttributes<"div">) => Element) | undefined

Render the element yourself

ArrowTip

PropDefaultType
element((attributes: HTMLAttributes<"div">) => Element) | undefined

Render the element yourself

Title

PropDefaultType
element((attributes: HTMLAttributes<"div">) => Element) | undefined

Render the element yourself

Description

PropDefaultType
element((attributes: HTMLAttributes<"div">) => Element) | undefined

Render the element yourself

CloseTrigger

PropDefaultType
element((attributes: HTMLAttributes<"button">) => Element) | undefined

Render the element yourself

View page on GitHub