Skip to content
+

Popover

Popovers are interactive floating elements that display rich content, anchored to a trigger element when a user clicks or optionally hovers over it.

PopoverArrow API

Import

import * as Popover from '@base_ui/react/Popover';
const PopoverArrow = Popover.Arrow;

Props

Props of the native component are also available.

NameTypeDefaultDescription
classNamefunc
| string
-

Class names applied to the element or a function that returns them based on the component's state.

hideWhenUncenteredboolfalse

If true, the arrow is hidden when it can't point to the center of the anchor element.

renderelement
| func
-

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use PopoverArrow to change the default props of this component with the theme.

PopoverBackdrop API

Import

import * as Popover from '@base_ui/react/Popover';
const PopoverBackdrop = Popover.Backdrop;

Props

Props of the native component are also available.

NameTypeDefaultDescription
classNamefunc
| string
-

Class names applied to the element or a function that returns them based on the component's state.

containerHTML element
| func
false

The container element to which the backdrop is appended to.

keepMountedboolfalse

If true, the backdrop remains mounted when the popover content is closed.

renderelement
| func
-

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use PopoverBackdrop to change the default props of this component with the theme.

PopoverClose API

Import

import * as Popover from '@base_ui/react/Popover';
const PopoverClose = Popover.Close;

Props

Props of the native component are also available.

NameTypeDescription
classNamefunc
| string

Class names applied to the element or a function that returns them based on the component's state.

renderelement
| func

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use PopoverClose to change the default props of this component with the theme.

PopoverDescription API

Import

import * as Popover from '@base_ui/react/Popover';
const PopoverDescription = Popover.Description;

Props

Props of the native component are also available.

NameTypeDescription
classNamefunc
| string

Class names applied to the element or a function that returns them based on the component's state.

renderelement
| func

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use PopoverDescription to change the default props of this component with the theme.

PopoverPopup API

Import

import * as Popover from '@base_ui/react/Popover';
const PopoverPopup = Popover.Popup;

Props

Props of the native component are also available.

NameTypeDescription
classNamefunc
| string

Class names applied to the element or a function that returns them based on the component's state.

renderelement
| func

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use PopoverPopup to change the default props of this component with the theme.

PopoverPositioner API

Import

import * as Popover from '@base_ui/react/Popover';
const PopoverPositioner = Popover.Positioner;

Props

Props of the native component are also available.

NameTypeDefaultDescription
alignment'center'
| 'end'
| 'start'
'center'

The alignment of the popover popup element to the anchor element along its cross axis.

alignmentOffsetnumber0

The offset of the popover popup element along its alignment axis.

anchorHTML element
| object
| func
-

The element to which the popover popup element is anchored to.

arrowPaddingnumber5

Determines the padding between the arrow and the popover popup edges. Useful when the popover popup element has rounded corners via border-radius.

classNamefunc
| string
-

Class names applied to the element or a function that returns them based on the component's state.

collisionBoundaryHTML element
| Array<HTML element>
| string
| { height?: number, width?: number, x?: number, y?: number }
'clippingAncestors'

The boundary that the popover popup element should be constrained to.

collisionPaddingnumber
| { bottom?: number, left?: number, right?: number, top?: number }
5

The padding between the popover popup element and the edges of the collision boundary to add whitespace between them to prevent them from touching.

containerHTML element
| func
-

The container element to which the popover positioner is appended to.

hideWhenDetachedboolfalse

Whether the popover popup element is hidden if it appears detached from its anchor element due to the anchor element being clipped (or hidden) from view.

keepMountedboolfalse

Whether the popover popup remains mounted in the DOM while closed.

positionStrategy'absolute'
| 'fixed'
'absolute'

The CSS position strategy for positioning the popover popup element.

renderelement
| func
-

A function to customize rendering of the component.

side'bottom'
| 'left'
| 'right'
| 'top'
'bottom'

The side of the anchor element that the popover popup element should be placed at.

sideOffsetnumber0

The gap between the anchor element and the popover popup element.

stickyboolfalse

Whether to allow the popover to remain stuck in view while the anchor element is scrolled out of view.


The ref is forwarded to the root element.

Theme default props

You can use PopoverPositioner to change the default props of this component with the theme.

PopoverRoot API

Import

import * as Popover from '@base_ui/react/Popover';
const PopoverRoot = Popover.Root;

Props

Props of the native component are also available.

NameTypeDefaultDescription
animatedbooltrue

Whether the tooltip can animate, adding animation-related attributes and allowing for exit animations to play. Useful to disable in tests to remove async behavior.

closeDelaynumber0

The delay in milliseconds until the popover popup is closed when openOnHover is true.

defaultOpenbool-

Specifies whether the popover is open initially when uncontrolled.

delaynumber300

The delay in milliseconds until the popover popup is opened when openOnHover is true.

delayType'hover'
| 'rest'
'rest'

The delay type to use when openOnHover is true. rest means the delay represents how long the user's cursor must rest on the trigger before the popover popup is opened. hover means the delay represents how long to wait as soon as the user's cursor has entered the trigger.

followCursorAxis'none'
| 'x'
| 'y'
'none'

Determines which axis the tooltip should follow the cursor on.

onOpenChangefunc-

Callback fired when the popover popup is requested to be opened or closed. Use when controlled.

openbool-

If true, the popover popup is open. Use when controlled.

openOnHoverboolfalse

If true, the popover popup opens when the trigger is hovered.


The component cannot hold a ref.

PopoverTitle API

Import

import * as Popover from '@base_ui/react/Popover';
const PopoverTitle = Popover.Title;

Props

Props of the native component are also available.

NameTypeDescription
classNamefunc
| string

Class names applied to the element or a function that returns them based on the component's state.

renderelement
| func

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use PopoverTitle to change the default props of this component with the theme.

PopoverTrigger API

Import

import * as Popover from '@base_ui/react/Popover';
const PopoverTrigger = Popover.Trigger;

Props

Props of the native component are also available.

NameTypeDescription
classNamefunc
| string

Class names applied to the element or a function that returns them based on the component's state.

renderelement
| func

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use PopoverTrigger to change the default props of this component with the theme.