Popover API

API documentation for Popover component

Popover#

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?: PopoverInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: PopoverInstance) => 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<PopoverPassThrough>
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: PopoverInstance) => 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.
dismissableboolean
true
Enables to hide the overlay when outside is clicked.
appendToHTMLElement | "body" | "self"
body
A valid query selector or an HTMLElement to specify where the overlay gets attached.
baseZIndexnumber
0
Base zIndex value to use in layering.
autoZIndexboolean
true
Whether to automatically manage layering.
breakpointsPopoverBreakpoints
null
Object literal to define widths per screen size.
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
visibleboolean
false
Current visible state as a boolean.

Exposes#

Defines the methods and properties exposed by Popover component.

nametypedefaultdescription
hide() => void
null
Hides the popover.
show() => void
null
Shows the popover.
onContentKeydown(event: KeyboardEvent<HTMLDivElement>) => void
null
The function to handle the content keydown event.
triggerRefRefObject<{ elementRef: RefObject<HTMLElement> }>
undefined
A valid query selector or an HTMLElement to specify where the trigger gets attached.
containerRefRefObject<{ elementRef: RefObject<HTMLElement> }>
undefined
A valid query selector or an HTMLElement to specify where the container gets attached.
onBeforeEnter() => void
null
Callback fired before enter animation.
onLeave() => void
null
Callback fired on leave.
onAfterLeave() => void
null
Callback fired after leave animation.
onOverlayClick() => void
null
Callback fired when the overlay is clicked.

Interfaces#

Defines passthrough(pt) options of Popover component.

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

Types#

Instance of Popover component.

values
ComponentInstance<PopoverProps, PopoverState, PopoverExposes>

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.
style(CSSProperties | ((instance?: ButtonInstance) => CSSProperties)) & (CSSProperties | ((instance?: PopoverTriggerInstance) => CSSProperties))
null
The style to apply to the component.
className(string | ((instance?: ButtonInstance) => string)) & (string | ((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.
ptButtonPassThrough & Record<PropertyKey, unknown> & 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.
children(ReactNode | ((instance: ButtonInstance) => ReactNode)) & (ReactNode | ((instance: PopoverTriggerInstance) => ReactNode))
null
The children to render.
size"small" | "large" | "normal"
null
Size of the Button.
severitystring & {} | "secondary" | "info" | "success" | "warn" | "danger" | "contrast" | "help"
null
Severity type of the Button.
variant"link" | "text" | "outlined"
null
Variant of the Button.
plainboolean
null
Whether to show the Button with a plain style.
roundedboolean
null
Whether to show the Button with a rounded style.
raisedboolean
null
Whether to show the Button with a raised style.
iconOnlyboolean
null
Whether to show the Button with a borderless style.
fluidboolean
null
Whether to show the Button with a fluid width.
[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
popoverPopoverInstance
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
popoverPopoverInstance
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
popoverPopoverInstance
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.
style(CSSProperties | ((instance?: ButtonInstance) => CSSProperties)) & (CSSProperties | ((instance?: PopoverCloseInstance) => CSSProperties))
null
The style to apply to the component.
className(string | ((instance?: ButtonInstance) => string)) & (string | ((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.
ptButtonPassThrough & Record<PropertyKey, unknown> & 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.
children(ReactNode | ((instance: ButtonInstance) => ReactNode)) & (ReactNode | ((instance: PopoverCloseInstance) => ReactNode))
null
The children to render.
size"small" | "large" | "normal"
null
Size of the Button.
severitystring & {} | "secondary" | "info" | "success" | "warn" | "danger" | "contrast" | "help"
null
Severity type of the Button.
variant"link" | "text" | "outlined"
null
Variant of the Button.
plainboolean
null
Whether to show the Button with a plain style.
roundedboolean
null
Whether to show the Button with a rounded style.
raisedboolean
null
Whether to show the Button with a raised style.
iconOnlyboolean
null
Whether to show the Button with a borderless style.
fluidboolean
null
Whether to show the Button with a fluid width.
[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
popoverPopoverInstance
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>