Overlays
Leave feedbackA 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
nodeRequiredSpecifies the content of the
Overlay. - container
elementType|funcA component instance, DOM node, or function that returns either. The overlay will be positioned in relation to the target.
- onEnter
funcCallback fired before the
Overlaytransitions in. - onEntered
funcCallback fired after the
Overlayfinishes transitioning in. - onEntering
funcCallback fired as the
Overlaybegins to transition in. - onExit
funcCallback fired right before the
Overlaytransitions out - onExited
funcCallback fired after the
Overlayfinishes transitioning out. - onExiting
funcCallback fired as the Overlay begins to transition out.
- onHide
funcA callback invoked by the overlay when it wishes to be hidden. Required if
rootCloseis 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
Overlayin relation to it's target. - popperConfig
shape{}Default{}A set of popper options and props passed directly to
Popper. - rootClose
boolDefaultfalseSpecify whether the overlay should trigger
onHidewhen the user clicks outside the overlay. - rootCloseEvent
enum'click' | 'mousedown'Specify event for triggering a “root close” toggle.
- show
boolDefaultfalseSet the visibility of the
Overlay. - target
elementType|funcThe visibility of the
Overlay.showis a controlled prop so should be paired withonToggleto avoid breaking user interactions.Manually toggling show does not wait for delay to change the visibility.
Controls
onToggle. - transition
funcDefaultFadeAnimate the entering and exiting of the Overlay.
truewill use the<Fade>transition, or a custom react-transition-group<Transition>component can be provided.
- children
element|funcRequiredSpecifies the content of the
OverlayTrigger. - overlay
element|funcRequiredAn element or text to overlay next to the target.
- defaultShow
boolDefaultfalseThe initial visibility state of the
Overlay. - delay
number|shape{}A millisecond delay amount to show and hide the
Overlayonce triggered. - flip
boolThe initial flip state of the
Overlay. - onHide
func - onToggle
funcA callback that fires when the user triggers a change in tooltip visibility.
onToggleis called with the desired next show, and generally should be passed back to theshowprop.onTogglefires 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
Overlayin relation to it's target. - popperConfig
shape{}Default{}A
Popper.jsconfig object passed to the the underlying popper instance. - show
boolThe visibility of the
Overlay.showis a controlled prop so should be paired withonToggleto 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
Overlayvisibility.
Usage Insights#
OverlayTrigger
| Project Name | Paragon Version | Instance Count | |
|---|---|---|---|
| frontend-app-account | 20.44.0 | 1 | |
| frontend-app-admin-portal | 20.39.2 | 13 | |
| frontend-app-authn | 20.45.5 | 1 | |
| frontend-app-course-authoring | 20.35.1 | 2 | |
| frontend-app-discussions | 20.44.0 | 19 | |
| frontend-app-gradebook | 20.45.0 | 1 | |
| frontend-app-learner-portal-enterprise | 20.45.1 | 1 | |
| frontend-app-learner-record | 20.45.0 | 2 | |
| frontend-app-learning | 20.28.4 | 9 | |
| frontend-app-ora-grading | 20.45.1 | 2 | |
| frontend-app-publisher | 20.28.5 | 2 | |
| frontend-app-support-tools | 20.45.0 | 1 | |
| frontend-component-header-edx | 20.45.5 | 1 | |
| frontend-component-header | 20.45.5 | 1 | |
| frontend-lib-content-components | 20.45.0 | 3 | |
| prospectus | 20.45.2 | 6 |