Tooltip API
Demos
For examples and details on the usage of this React component, visit the component demo pages:
Import
import Tooltip from '@mui/material/Tooltip';
// or
import { Tooltip } from '@mui/material';
Props
Props of the native component are also available.
The components used for each slot inside.
This prop is an alias for the slots
prop. It's recommended to use the slots
prop instead.
Type:
{ Arrow?: elementType, Popper?: elementType, Tooltip?: elementType, Transition?: elementType }
Default:
{}
The extra props for the slot components. You can override the existing props or add new ones.
This prop is an alias for the slotProps
prop. It's recommended to use the slotProps
prop instead, as componentsProps
will be deprecated in the future.
Type:
{ arrow?: object, popper?: object, tooltip?: object, transition?: object }
Default:
{}
Set to true
if the title
acts as an accessible description. By default the title
acts as an accessible label for the child.
Type:
bool
Default:
false
Makes a tooltip not interactive, i.e. it will close when the user hovers over the tooltip before the leaveDelay
is expired.
Type:
bool
Default:
false
The number of milliseconds to wait before showing the tooltip. This prop won't impact the enter touch delay (enterTouchDelay
).
Type:
number
Default:
100
The number of milliseconds to wait before showing the tooltip when one was already recently opened.
Type:
number
Default:
0
The number of milliseconds a user must touch the element before showing the tooltip.
Type:
number
Default:
700
This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id.
Type:
string
The number of milliseconds to wait before hiding the tooltip. This prop won't impact the leave touch delay (leaveTouchDelay
).
Type:
number
Default:
0
The number of milliseconds after the user stops touching an element before hiding the tooltip.
Type:
number
Default:
1500
Callback fired when the component requests to be closed.
Type:
func
Signature:
function(event: React.SyntheticEvent) => void
event
The event source of the callback.
Callback fired when the component requests to be open.
Type:
func
Signature:
function(event: React.SyntheticEvent) => void
event
The event source of the callback.
Tooltip placement.
Type:
'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top'
Default:
'bottom'
The extra props for the slot components. You can override the existing props or add new ones.
This prop is an alias for the componentsProps
prop, which will be deprecated in the future.
Type:
{ arrow?: object, popper?: object, tooltip?: object, transition?: object }
Default:
{}
The components used for each slot inside.
This prop is an alias for the components
prop, which will be deprecated in the future.
Type:
{ arrow?: elementType, popper?: elementType, tooltip?: elementType, transition?: elementType }
Default:
{}
The system prop that allows defining system overrides as well as additional CSS styles.
Type:
Array<func | object | bool> | func | object
Tooltip title. Zero-length titles string, undefined, null and false are never displayed.
Type:
node
The component used for the transition. Follow this guide to learn more about the requirements for this component.
Type:
elementType
Default:
Grow
Props applied to the transition element. By default, the element is based on this Transition
component.
Type:
object
ref
is forwarded to the root element.Theme default props
You can useMuiTooltip
to change the default props of this component with the theme.CSS
The following class names are useful for styling with CSS (the state classes are marked).
To learn more, visit the component customization page.
Styles applied to the Popper component unless disableInteractive={true}
.
Styles applied to the Popper component unless the tooltip is open.
Styles applied to the tooltip (label wrapper) element if arrow={true}
.
Styles applied to the tooltip (label wrapper) element if the tooltip is opened by touch.
Styles applied to the tooltip (label wrapper) element if placement
contains "left".
Styles applied to the tooltip (label wrapper) element if placement
contains "right".
Styles applied to the tooltip (label wrapper) element if placement
contains "top".
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverrides
property in a custom theme.