Overlay
A set of components for positioning beautiful overlays, tooltips, popovers, and anything else you need.
This component is used to power Tooltips and Popovers.
This is a pass through component from React-Bootstrap.
See React-Bootstrap for additional documentation.
Basic usage
Any Paragon component or export may be added to the code example.
Props API#
- children
node
RequiredSpecifies the content of the
Overlay
. - container
elementType
|func
A component instance, DOM node, or function that returns either. The overlay will be positioned in relation to the target.
- onEnter
func
Callback fired before the
Overlay
transitions in. - onEntered
func
Callback fired after the
Overlay
finishes transitioning in. - onEntering
func
Callback fired as the
Overlay
begins to transition in. - onExit
func
Callback fired right before the
Overlay
transitions out - onExited
func
Callback fired after the
Overlay
finishes transitioning out. - onExiting
func
Callback fired as the Overlay begins to transition out.
- onHide
func
A callback invoked by the overlay when it wishes to be hidden. Required if
rootClose
is specified. - placement
enum
'auto-start' | 'auto' | 'auto-end' | 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start'Default'top'The placement of the
Overlay
in relation to it's target. - popperConfig
shape
{}Default{}A set of popper options and props passed directly to
Popper
. - rootClose
bool
DefaultfalseSpecify whether the overlay should trigger
onHide
when the user clicks outside the overlay. - rootCloseEvent
enum
'click' | 'mousedown'Specify event for triggering a “root close” toggle.
- show
bool
DefaultfalseSet the visibility of the
Overlay
. - target
elementType
|func
The visibility of the
Overlay
.show
is a controlled prop so should be paired withonToggle
to avoid breaking user interactions.Manually toggling show does not wait for delay to change the visibility.
Controls
onToggle
. - transition
func
DefaultFadeAnimate the entering and exiting of the Overlay.
true
will use the<Fade>
transition, or a custom react-transition-group<Transition>
component can be provided.
- children
element
|func
RequiredSpecifies the content of the
OverlayTrigger
. - overlay
element
|func
RequiredAn element or text to overlay next to the target.
- defaultShow
bool
DefaultfalseThe initial visibility state of the
Overlay
. - delay
number
|shape
{}A millisecond delay amount to show and hide the
Overlay
once triggered. - flip
bool
The initial flip state of the
Overlay
. - onHide
func
- onToggle
func
A callback that fires when the user triggers a change in tooltip visibility.
onToggle
is called with the desired next show, and generally should be passed back to theshow
prop.onToggle
fires after the configureddelay
.Controls
show
. - placement
enum
'auto-start' | 'auto' | 'auto-end' | 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start'The placement of the
Overlay
in relation to it's target. - popperConfig
shape
{}Default{}A
Popper.js
config object passed to the the underlying popper instance. - show
bool
The visibility of the
Overlay
.show
is a controlled prop so should be paired withonToggle
to avoid breaking user interactions.Manually toggling show does not wait for delay to change the visibility.
Controls
onToggle
. - target
EventTarget
- trigger
triggerType
|triggerType
[]
Default['hover', 'focus']Specify which action or actions trigger
Overlay
visibility.
Usage Insights#
OverlayTrigger
Project Name | Paragon Version | Instance Count | |
---|---|---|---|
frontend-app-account | 20.46.3 | 1 | |
frontend-app-admin-portal | 20.46.3 | 17 | |
frontend-app-authn | 20.46.2 | 1 | |
frontend-app-course-authoring | 20.46.2 | 3 | |
frontend-app-discussions | 20.44.0 | 19 | |
frontend-app-gradebook | 20.45.0 | 1 | |
frontend-app-learner-portal-enterprise | 20.45.4 | 1 | |
frontend-app-learner-record | 20.46.3 | 2 | |
frontend-app-learning | 20.46.0 | 8 | |
frontend-app-ora-grading | 20.46.3 | 2 | |
frontend-app-publisher | 20.46.2 | 2 | |
frontend-app-support-tools | 20.46.0 | 1 | |
frontend-component-header-edx | 21.5.6 | 2 | |
frontend-component-header | 21.5.6 | 1 | |
frontend-lib-content-components | 21.5.6 | 3 | |
prospectus | 20.46.2 | 8 |