Skip to content

Tooltip API

API reference docs for the React Tooltip component. Learn about the props, CSS, and other APIs of this exported module.

Component demos

Import

import Tooltip from '@mui/material/Tooltip';
// or
import { Tooltip } from '@mui/material';
Learn about the difference by reading this guide on minimizing bundle size.

Props

Props of the native component are also available.

childrenRequired

Tooltip reference element.

Type:element


arrow

If true, adds an arrow to the tooltip.

Type:bool

Default:false


classes

Override or extend the styles applied to the component.

See CSS API below for more details.

Type:object


components

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:{}


componentsProps

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:{}


describeChild

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


disableFocusListener

Do not respond to focus-visible events.

Type:bool

Default:false


disableHoverListener

Do not respond to hover events.

Type:bool

Default:false


disableInteractive

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


disableTouchListener

Do not respond to long press touch events.

Type:bool

Default:false


enterDelay

The number of milliseconds to wait before showing the tooltip. This prop won't impact the enter touch delay (enterTouchDelay).

Type:number

Default:100


enterNextDelay

The number of milliseconds to wait before showing the tooltip when one was already recently opened.

Type:number

Default:0


enterTouchDelay

The number of milliseconds a user must touch the element before showing the tooltip.

Type:number

Default:700


followCursor

If true, the tooltip follow the cursor over the wrapped element.

Type:bool

Default:false


id

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


leaveDelay

The number of milliseconds to wait before hiding the tooltip. This prop won't impact the leave touch delay (leaveTouchDelay).

Type:number

Default:0


leaveTouchDelay

The number of milliseconds after the user stops touching an element before hiding the tooltip.

Type:number

Default:1500


onClose

Callback fired when the component requests to be closed.

Type:func

Signature:
function(event: React.SyntheticEvent) => void
  • event The event source of the callback.

onOpen

Callback fired when the component requests to be open.

Type:func

Signature:
function(event: React.SyntheticEvent) => void
  • event The event source of the callback.

open

If true, the component is shown.

Type:bool


placement

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'


PopperComponent

The component used for the popper.

Type:elementType

Default:Popper


PopperProps

Props applied to the Popper element.

Type:object

Default:{}


slotProps

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:{}


slots

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:{}


sx

The system prop that allows defining system overrides as well as additional CSS styles.

See the `sx` page for more details.

Type:Array<func
| object
| bool>
| func
| object


title

Tooltip title. Zero-length titles string, undefined, null and false are never displayed.

Type:node


TransitionComponent

The component used for the transition. Follow this guide to learn more about the requirements for this component.

Type:elementType

Default:Grow


TransitionProps

Props applied to the transition element. By default, the element is based on this Transition component.

Type:object


The ref is forwarded to the root element.

Theme default props

You can use MuiTooltip to change the default props of this component with the theme.


CSS classes

These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.

.MuiTooltip-arrow

Styles applied to the arrow element.

Rule name:arrow


.MuiTooltip-popper

Styles applied to the Popper component.

Rule name:popper


.MuiTooltip-popperArrow

Styles applied to the Popper component if arrow={true}.

Rule name:popperArrow


.MuiTooltip-popperClose

Styles applied to the Popper component unless the tooltip is open.

Rule name:popperClose


.MuiTooltip-popperInteractive

Styles applied to the Popper component unless disableInteractive={true}.

Rule name:popperInteractive


.MuiTooltip-tooltip

Styles applied to the tooltip (label wrapper) element.

Rule name:tooltip


.MuiTooltip-tooltipArrow

Styles applied to the tooltip (label wrapper) element if arrow={true}.

Rule name:tooltipArrow


.MuiTooltip-tooltipPlacementBottom

Styles applied to the tooltip (label wrapper) element if placement contains "bottom".

Rule name:tooltipPlacementBottom


.MuiTooltip-tooltipPlacementLeft

Styles applied to the tooltip (label wrapper) element if placement contains "left".

Rule name:tooltipPlacementLeft


.MuiTooltip-tooltipPlacementRight

Styles applied to the tooltip (label wrapper) element if placement contains "right".

Rule name:tooltipPlacementRight


.MuiTooltip-tooltipPlacementTop

Styles applied to the tooltip (label wrapper) element if placement contains "top".

Rule name:tooltipPlacementTop


.MuiTooltip-touch

Styles applied to the tooltip (label wrapper) element if the tooltip is opened by touch.

Rule name:touch



You can override the style of the component using one of these customization options: