Popover API

API documentation for Popover component

PopoverRoot#

Props#

Defines valid properties in Popover component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: PopoverRootInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: PopoverRootInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<PopoverRootPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: PopoverRootInstance) => ReactNode)
null
The children to render.
defaultOpenboolean
undefined
Whether the popover is open by default.
openboolean
undefined
Whether the popover is open.
onOpenChange(event: usePopoverOpenChangeEvent) => void
undefined
Callback to invoke when the open state changes.
closeOnEscapeboolean
true
Specifies if pressing escape key should hide the dialog.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Defines valid state in Popover component.

nametypedefaultdescription
openboolean
null
Whether the popover is open.
anchorElHTMLElement
null
The anchor element.
positionerElHTMLDivElement
null
The positioner element.
arrowElHTMLDivElement
null
The arrow element.

Exposes#

Defines the methods and properties exposed by Popover component.

nametypedefaultdescription
stateusePopoverState
null
The state of the usePopover.
presence{ present: boolean; exiting: boolean; mounted: boolean; ref: RefObject<HTMLElement> }
null
The presence of the usePopover.
setOpen(open: boolean, originalEvent?: Event) => void
null
Sets the open state.
setArrowRef(node: HTMLDivElement) => void
null
Sets the arrow element.
setAnchorRef(node: HTMLElement) => void
null
Sets the anchor element.
setPositionerRef(node: HTMLDivElement) => void
null
Sets the positioner element.

Interfaces#

Defines passthrough(pt) options of Popover component.

nametypedefaultdescription
rootPopoverRootPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of Popover component.

values
ComponentInstance<PopoverRootProps, PopoverRootState, PopoverRootExposes>

PopoverTrigger#

Props#

Defines valid properties in PopoverTrigger component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: PopoverTriggerInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: PopoverTriggerInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<PopoverTriggerPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: PopoverTriggerInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by PopoverTrigger component.

nametypedefaultdescription
popoverPopoverRootInstance
null
The Popover component instance.

Interfaces#

Defines passthrough(pt) options of PopoverTrigger component.

nametypedefaultdescription
rootPopoverTriggerPassThroughType<HTMLAttributes<HTMLButtonElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of PopoverTrigger component.

values
ComponentInstance<PopoverTriggerProps, PopoverTriggerState, PopoverTriggerExposes>

PopoverPortal#

Props#

Defines valid properties in PopoverPortal component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
style(CSSProperties | ((instance?: PortalInstance) => CSSProperties)) & (CSSProperties | ((instance?: PopoverPortalInstance) => CSSProperties))
null
The style to apply to the component.
className(string | ((instance?: PortalInstance) => string)) & (string | ((instance?: PopoverPortalInstance) => string))
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptPortalPassThrough & Record<PropertyKey, unknown> & PopoverPortalPassThrough
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
children(ReactNode | ((instance: PortalInstance) => ReactNode)) & (ReactNode | ((instance: PopoverPortalInstance) => ReactNode))
null
The children to render.
elementReactNode
null
The element to be rendered as the portal.
appendToHTMLElement | "body" | "self"
'body'
The DOM element where the portal should be appended to.
visibleboolean
false
Whether the portal is visible or not.
onMounted() => void
null
Callback function to invoke when the portal is mounted.
onUnmounted() => void
null
Callback function to invoke when the portal is unmounted.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by PopoverPortal component.

nametypedefaultdescription
popoverPopoverRootInstance
null
The Popover component instance.

Interfaces#

Defines passthrough(pt) options of PopoverPortal component.

nametypedefaultdescription
rootPopoverPortalPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of PopoverPortal component.

values
ComponentInstance<PopoverPortalProps, PopoverPortalState, PopoverPortalExposes>

PopoverContent#

Props#

Defines valid properties in PopoverContent component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: PopoverContentInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: PopoverContentInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<PopoverContentPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: PopoverContentInstance) => ReactNode)
null
The children to render.
autoFocusboolean
true
Whether to focus the first focusable element when the popover is opened.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by PopoverContent component.

nametypedefaultdescription
popoverPopoverRootInstance
null
The Popover component instance.

Interfaces#

Defines passthrough(pt) options of PopoverContent component.

nametypedefaultdescription
rootPopoverContentPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of PopoverContent component.

values
ComponentInstance<PopoverContentProps, PopoverContentState, PopoverContentExposes>

PopoverClose#

Props#

Defines valid properties in PopoverClose component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: PopoverCloseInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: PopoverCloseInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<PopoverClosePassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: PopoverCloseInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by PopoverClose component.

nametypedefaultdescription
popoverPopoverRootInstance
null
The Popover component instance.

Interfaces#

Defines passthrough(pt) options of PopoverClose component.

nametypedefaultdescription
rootPopoverClosePassThroughType<HTMLAttributes<HTMLButtonElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of PopoverClose component.

values
ComponentInstance<PopoverCloseProps, PopoverCloseState, PopoverCloseExposes>