Components
Popover

Popover

A popover is a non-modal dialog that floats around a trigger. It is used to display contextual information to the user, and should be paired with a clickable trigger element.

API reference docs for the component. Learn about the props, CSS, and other APIs of this exported module.

PopoverProps

autoFocus

boolean

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

closeOnEsc

boolean

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

closeOnInteractOutside

boolean

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

getRootNode

() => ShadowRoot | Node | Document

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

id

string

The unique identifier of the machine.

ids

Partial<{ anchor: string trigger: string content: string title: string description: string closeTrigger: string positioner: string arrow: string }>

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

initialFocusEl

HTMLElement | (() => MaybeElement)

The element to focus on when the popover is opened.

modal

boolean

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

onEscapeKeyDown

(event: KeyboardEvent) => void

Function called when the escape key is pressed

onFocusOutside

(event: FocusOutsideEvent) => void

Function called when the focus is moved outside the combobox

onInteractOutside

(event: InteractOutsideEvent) => void

Function called when an interaction happens outside the combobox

onOpenChange

(details: OpenChangeDetails) => void

Function invoked when the popover opens or closes

onPointerDownOutside

(event: PointerDownOutsideEvent) => void

Function called when the pointer is pressed down outside the combobox

open

boolean

Whether the popover is open

portalled

boolean

Whether the popover is rendered in a portal

positioning

PositioningOptions

The user provided options used to position the popover content

PopoverContext

anchorProps

Dict<any>

arrowProps

Dict<any>

arrowTipProps

Dict<any>

close

() => void

Function to close the popover

closeTriggerProps

Dict<any>

contentProps

Dict<any>

descriptionProps

Dict<any>

isOpen

boolean

Whether the popover is open

open

() => void

Function to open the popover

portalled

boolean

Whether the popover is portalled

positionerProps

Dict<any>

setPositioning

(options?: Partial<PositioningOptions> | undefined) => void

Function to reposition the popover

titleProps

Dict<any>

triggerProps

Dict<any>

PopoverContentProps

lazyMount

boolean

Whether to enable lazy mounting. Defaults to `false`.

onExitComplete

() => void

present

boolean

unmountOnExit

boolean

Whether to unmount on exit. Defaults to `false`.