Skip to content
Skip to content

ChartsAxis API

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

Demos

Import

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

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

Props

NameTypeDefaultDescription
slotPropsobject{}

The props used for each component slot.

slotsobject{}

Overridable component slots.

See Slots API below for more details.

The component cannot hold a ref.

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
.MuiChartsAxis-bottombottomStyles applied to the bottom axis.
.MuiChartsAxis-directionXdirectionXStyles applied to x-axes.
.MuiChartsAxis-directionYdirectionYStyles applied to y-axes.
.MuiChartsAxis-labellabelStyles applied to the group containing the axis label.
.MuiChartsAxis-leftleftStyles applied to the left axis.
.MuiChartsAxis-linelineStyles applied to the main line element.
.MuiChartsAxis-rightrightStyles applied to the right axis.
.MuiChartsAxis-rootrootStyles applied to the root element.
.MuiChartsAxis-ticktickStyles applied to ticks.
.MuiChartsAxis-tickContainertickContainerStyles applied to group including the tick and its label.
.MuiChartsAxis-tickLabeltickLabelStyles applied to ticks label.
⚠️ For performance reasons, only the inline styles get considered for bounding box computation. Modifying text size by adding properties like font-size or letter-spacing to this class might cause labels to overlap.
.MuiChartsAxis-toptopStyles applied to the top axis.

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

Source code

If you did not find the information in this page, consider having a look at the implementation of the component for more detail.