Tooltip
The API documentation of the Tooltip React component.
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. This property is used with aria-describedby to solve the accessibility issue. If you don't provide this property. It fallback to a random generated id. | |
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. | |
TransitionComponent | union: string | func | object |
Grow | Transition component. |
TransitionProps | object | Properties applied to the Transition element. |
Any other properties supplied will be spread to the root element (native 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:
Name | Description |
---|---|
popper | Styles applied to the Popper component. |
tooltip | Styles applied to the tooltip (label wrapper) element. |
touch | Styles applied to the tooltip (label wrapper) element if the tooltip is opened by touch. |
tooltipPlacementLeft | Styles applied to the tooltip (label wrapper) element if placement contains "left". |
tooltipPlacementRight | Styles applied to the tooltip (label wrapper) element if placement contains "right". |
tooltipPlacementTop | Styles applied to the tooltip (label wrapper) element if placement contains "top". |
tooltipPlacementBottom | Styles applied to the tooltip (label wrapper) element if placement contains "bottom". |
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
.