Skip to content

ChartsTooltip API

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

Demos

Import

import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
// or
import { ChartsTooltip } from '@mui/x-charts';

Learn about the difference by reading this guide on minimizing bundle size.

Props

NameTypeDefaultDescription
axisContentelementType-

Component to override the tooltip content when trigger is set to 'axis'.

classesobject-

Override or extend the styles applied to the component.

See CSS classes API below for more details.

itemContentelementType-

Component to override the tooltip content when trigger is set to 'item'.

slotPropsobject{}

The props used for each component slot.

slotsobject{}

Overridable component slots.

See Slots API below for more details.

trigger'axis'
| 'item'
| 'none'
'item'

Select the kind of tooltip to display - 'item': Shows data about the item below the mouse. - 'axis': Shows values associated with the hovered x value - 'none': Does not display tooltip

The component cannot hold a ref.

Slots

Slot nameClass nameDefault componentDescription
popperChartsTooltipRootCustom component for the tooltip popper.
axisContentDefaultChartsAxisTooltipContentCustom component for displaying tooltip content when triggered by axis event.
itemContentDefaultChartsItemTooltipContentCustom component for displaying tooltip content when triggered by item event.

CSS classes

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

Class nameRule nameDescription
.MuiChartsTooltip-cellcellStyles applied to the cell element.
.MuiChartsTooltip-labelCelllabelCellStyles applied to the labelCell element.
.MuiChartsTooltip-markmarkStyles applied to the mark element.
.MuiChartsTooltip-markCellmarkCellStyles applied to the markCell element.
.MuiChartsTooltip-rootrootStyles applied to the root element.
.MuiChartsTooltip-rowrowStyles applied to the row element.
.MuiChartsTooltip-tabletableStyles applied to the table element.
.MuiChartsTooltip-valueCellvalueCellStyles applied to the valueCell element.

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