Tonic UI
Getting StartedColor ModeColor StyleVersionsContributing
THEME
BordersBreakpointsColorsOutlinesPositionsSpacingSizesShadowsTypography
BUILDING BLOCKS
BoxControlBox
UTILITIES

Tooltip

A tooltip is a brief, informative message that appears when a user interacts with an element. Tooltips are usually initiated in one of two ways: through a mouse-hover or keyboard-hover action.

The Tooltip component follows the WAI-ARIA Tooltip pattern.

Import

Usage

If the tooltip anchor is not a focusable content, just like the text string, you can wrap it with a Text component and set `tabIndex="0" to make it focusable.

EDITABLE EXAMPLE

With an icon

EDITABLE EXAMPLE

Hide the arrow

EDITABLE EXAMPLE

Tooltip with focusable content

If the children of Tooltip are focusable elements, Tooltip will show when you focus or hover on the a children element and will hide when you blur or move cursor out of the element.

EDITABLE EXAMPLE

Customized tooltips

EDITABLE EXAMPLE

Tooltip with Menu

EDITABLE EXAMPLE

Placement

Using the placement prop you can adjust where your tooltip will be displayed.

EDITABLE EXAMPLE

Props

NameTypeDefaultDescription
isOpenbooleanIf true, the tooltip is shown.
labelstring | ReactNodeThe label of the tooltip.
placementPopperJS.Placement'bottom'Position the tooltip relative to the trigger element as well as surrounding elements. Possible values: 'top', 'bottom', 'right', 'left', 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'right-start', 'right-end', 'left-start', 'left-end'
childrenReactNodeThe ReactNode element to be used as the trigger of the tooltip.
hideArrowbooleanIf true, hide the arrow tip on the tooltip.
arrowAtstringThe arrow is at the position of the popover. Possible values: 'left', 'right', 'top', 'bottom'
showDelaynumberThe delay in milliseconds for the tooltip to show.
hideDelaynumberThe delay in milliseconds for the tooltip to hide.
closeOnClickbooleanIf true, hide the tooltip when the trigger is clicked.
onOpenfunctionA callback called when the tooltip shows.
onClosefunctionA callback called when the tooltip hides.