v14.2.0

Playroom

Github

Popover

View Source

Copy
Edit

Scroll Me

Toggle Popover
Copy
Edit

Props

asReactReactNode

Controls the default component or tag being rendered.

anchorElementReactReactElement | unknown

The element to attach the popover to. Clones the element’s ref to calculate position relative to the optional relativeTo prop or the renderTo element.

keepInViewboolean

Attempts to keep popover in view clipping edges if too large.

Locks external scrollbars when open.

matchWidthsboolean | 'minimum'

Matches anchor and popover widths.

openboolean

Controls rendering of the popover.

offsetnumber

Controls the space between the popover and its anchor.

onRequestClose() => void

Called when the popover should close.

placement'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end'

Where to place the popover.

Where to place the popover relative to. Uses renderTo by default.

renderToHTMLElement | string

Where to render the popover into. Accepts an HTML element or selector. Uses the closest fixed parent or document.body by default. This will only be computed once on initial render.

shouldFlipboolean

Determines if the popover should flip or not when it overflows.

Calls as innerRef to calculate popover’s bounds.

  • Props
PreviousModalNextScrim