Popover

An accessible popup anchored to a button.

API reference

Import the component and place its parts the following way:

Anatomy
import { Popover } from '@base-ui-components/react/popover';

<Popover.Root>
  <Popover.Trigger />
  <Popover.Backdrop />
  <Popover.Positioner>
    <Popover.Popup>
      <Popover.Arrow />
      <Popover.Title />
      <Popover.Description />
      <Popover.Close />
    </Popover.Popup>
  </Popover.Positioner>
</Popover.Root>

Root

The foundation for building custom-styled popovers.

PropTypeDefault
closeDelaynumber0
defaultOpenbooleanfalse
delaynumber300
onOpenChange(open, event, reason) => voidundefined
openbooleanfalse
openOnHoverbooleanfalse

Trigger

Renders a trigger element that opens the popover.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Backdrop

Renders a backdrop for the popover.

PropTypeDefault
classNamestring | (state) => stringundefined
containerReact.Ref | HTMLElement | nullfalse
keepMountedbooleanfalse
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Positioner

The popover positioner element.

PropTypeDefault
align'start' | 'center' | 'end''center'
alignOffsetnumber0
anchor| React.Ref
| Element
| VirtualElement
| (() => Element
| VirtualElement
| null)
| null
undefined
arrowPaddingnumber5
classNamestring | (state) => stringundefined
collisionBoundary| 'clippingAncestors'
| Element
| Element[]
| Rect
'clipping-ancestors'
collisionPaddingnumber | Rect5
containerReact.Ref | HTMLElement | nullundefined
keepMountedbooleanfalse
positionMethod'absolute' | 'fixed''absolute'
render| React.ReactElement
| (props, state) => React.ReactElement
undefined
side| 'bottom'
| 'inline-end'
| 'inline-start'
| 'left'
| 'right'
| 'top'
'bottom'
sideOffsetnumber0
stickybooleanfalse
CSS VariableType
--anchor-heightnumber
--anchor-widthnumber
--available-heightnumber
--available-widthnumber
--transform-originstring

Renders the popover popup element.

PropTypeDefault
classNamestring | (state) => stringundefined
finalFocusReact.Refundefined
initialFocus| React.Ref
| (interactionType => HTMLElement | null)
undefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Arrow

Renders an arrow that points to the center of the anchor element.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Title

Renders a title element that labels the popover.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Description

Renders a description element that describes the popover.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined

Close

Renders a button that closes the popover when clicked.

PropTypeDefault
classNamestring | (state) => stringundefined
render| React.ReactElement
| (props, state) => React.ReactElement
undefined