<Tooltip> Component
<Tooltip> represents advisory information related to the element it belongs.
Here the demo:
<Tooltip> Component<Tooltip> represents advisory information related to the element it belongs.
Here the demo:
<Tooltip> ComponentThere are 2 ways to install <Tooltip> component into your react app project:
expanded PropertyExpands/Collapses the <Tooltip>.
The possible values are:
undefinedtruefalseHere the preview:
expandDelay PropertyDefines the minimum duration (in milliseconds) of the user for hovering/focusing of the corresponding component to show the <Tooltip>.
collapseDelay PropertyDefines the minimum duration (in milliseconds) of the user for leaving/un-focusing of the corresponding component to hide the <Tooltip>.
lazy PropertyDetermines whenever the <Tooltip>'s children should be rendered or not when the <Tooltip expanded={false}>.
The possible values are:
undefinedfalsetrueDetermines how the <Tooltip> should be floating on the target DOM reference.
floatingOn PropertyDetermines the target DOM reference where the <Tooltip> should be floating on.
If not set (undefined), the <Tooltip> becomes a normal element flow.
Here the preview:
floatingPlacement PropertyDetermines the location where the <Tooltip> should be floating on the target DOM reference.
Here the preview:
floatingPlacement='top'floatingStrategy PropertyDetermines the technical strategy how the <Tooltip> can float.
In most cases, you should not worry about the detail mechanism how the <Tooltip> can float.
The possible values are:
undefined'absolute''fixed'floatingAutoFlip PropertyAutomatically flips the floatingPlacement to opposite direction when the <Tooltip> is about to be clipped.
The possible values are:
undefinedtruefalseHere the preview:
floatingAutoShift PropertyAutomatically shifts the floatingPlacement to nearest safe position when the <Tooltip> is about to be clipped.
The possible values are:
undefinedtruefalseHere the preview:
floatingOffset PropertyThe distance (in pixel) between the <Tooltip> and the target DOM reference.
The possible values are:
undefined0Here the preview:
<Tooltip floatingOffset={0}>
floatingShift PropertyThe distance (in pixel) between the <Tooltip> and the default floatingPlacement location.
The possible values are:
undefined0Here the preview:
<Tooltip floatingShift={0}>
onFloatingUpdate PropertySets a callback function to be called when the <Tooltip> updates the position relative to the target DOM reference.
The callback function parameters:
event: FloatingPositionThe alternative appearances of the <Tooltip> layout without changing the <Tooltip>'s functionality.
size PropertyDefines the alternative size of the <Tooltip>.
The possible values are:
undefined'sm''md''lg'Here the preview:
theme PropertyDefines the contextual theme of the <Tooltip>.
The possible values are:
undefined'primary''secondary''success''info''warning''danger''light''dark'Here the preview:
gradient PropertyActivates a 3D mode of the <Tooltip>.
The possible values are:
undefined'inherit'truefalseHere the preview:
outlined PropertyActivates an outlined mode (background-less, contrast foreground, and contrast border) of the <Tooltip>.
The possible values are:
undefined'inherit'truefalseHere the preview:
mild PropertyActivates a mild mode (mild background, contrast foreground, and contrast border) of the <Tooltip>.
The possible values are:
undefined'inherit'truefalseHere the preview:
nude PropertyActivates an nude mode (background-less, padding-less, and border-less) of the <Tooltip>.
The possible values are:
undefinedtruefalseHere the preview:
Overwrites the internal (sub) components used as the composition of <Tooltip> component.
arrowComponent PropertyOverwrites the internal <Generic> component used as the arrow of <Tooltip> component.
<Tooltip arrowComponent={
<MyCustomArrow />
} />arrowRef PropertyGets the DOM reference of the internal <Generic> component used as the arrow of <Tooltip> component.
<Tooltip arrowRef={fooArrowRef} />is equivalent to:<Tooltip arrowComponent={
<Generic elmRef={fooArrowRef} />
} />Because <Tooltip> is made from <Popup>, so all properties from <Popup> are inherited.
There are several variables of <Tooltip> you can customize. Changing the variables affects all <Tooltip> instance and other components that depend on <Tooltip>.
Here the exposed variables:
The example of accessing, modifying, & adding variables: