Overlay
A powerful and flexible overlay component for showing things over, and next to, other things.
API
import Overlay from 'react-overlays/Overlay'
Built on top of Popper.js
, the overlay component is
great for custom tooltip overlays.
childrenrequired
A render prop that returns an element to overlay and position. See the react-popper documentation for more info.
container
A DOM Element, Ref to an element, or function that returns either. The container
will have the Portal children
appended to it.
containerPadding
Control how much space there is between the edge of the boundary element and overlay.
A convenience shortcut to setting popperConfig.modfiers.preventOverflow.padding
flip
Enables the Popper.js flip
modifier, allowing the Overlay to
automatically adjust it's placement in case of overlap with the viewport or toggle.
Refer to the flip docs for more info
onEnter
Callback fired before the Overlay transitions in
onEntered
Callback fired after the Overlay finishes transitioning in
onEntering
Callback fired as the Overlay begins to transition in
onExit
Callback fired right before the Overlay transitions out
onExited
Callback fired after the Overlay finishes transitioning out
onExiting
Callback fired as the Overlay begins to transition out
onHide
A Callback fired by the Overlay when it wishes to be hidden.
required when rootClose
is true
.
placement
Specify where the overlay element is positioned in relation to the target element
popperConfig
A set of popper options and props passed directly to react-popper's Popper component.
rootClose
Specify whether the overlay should trigger onHide
when the user clicks outside the overlay
rootCloseDisabled
Specify disabled for disable RootCloseWrapper
rootCloseEvent
Specify event for toggling overlay
show
Set the visibility of the Overlay
target
A DOM Element, Ref to an element, or function that returns either. The target
element is where
the overlay is positioned relative to.
transition
A react-transition-group@2.0.0
<Transition/>
component
used to animate the overlay as it changes visibility.