Tooltip

Tooltip

Props

Name Type Default Description
childrenĀ * element Tooltip reference element.
classes object Override or extend the styles applied to the component. See CSS API below for more details.
disableFocusListener bool false Do not respond to focus events.
disableHoverListener bool false Do not respond to hover events.
disableTouchListener bool false Do not respond to long press touch events.
enterDelay number 0 The number of milliseconds to wait before showing the tooltip. This property won't impact the enter touch delay (enterTouchDelay).
enterTouchDelay number 1000 The number of milliseconds a user must touch the element before showing the tooltip.
id string The relationship between the tooltip and the wrapper component is not clear from the DOM. By providing this property, we can use aria-describedby to solve the accessibility issue.
leaveDelay number 0 The number of milliseconds to wait before hiding the tooltip. This property won't impact the leave touch delay (leaveTouchDelay).
leaveTouchDelay number 1500 The number of milliseconds after the user stops touching an element before hiding the tooltip.
onClose func Callback fired when the tooltip requests to be closed.

Signature:
function(event: object) => void
event: The event source of the callback
onOpen func Callback fired when the tooltip requests to be open.

Signature:
function(event: object) => void
event: The event source of the callback
open bool If true, the tooltip is shown.
placement enum: 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top'
'bottom' Tooltip placement
PopperProps object Properties applied to the Popper element.
titleĀ * node Tooltip title. Zero-length titles string are never displayed.

Any other properties supplied will be spread to the root element.

CSS API

You can override all the class names injected by Material-UI thanks to the classes property. This property accepts the following keys:

  • popper
  • open
  • tooltip
  • touch
  • tooltipPlacementLeft
  • tooltipPlacementRight
  • tooltipPlacementTop
  • tooltipPlacementBottom

Have a look at overriding with classes section and the implementation of the component for more detail.

If using the overrides key of the theme as documented here, you need to use the following style sheet name: MuiTooltip.

Demos