Skip to contentSkip to content

BarElement API

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

Demos

Import

import { BarElement } from '@mui/x-charts/BarChart';
// or
import { BarElement } from '@mui/x-charts';
// or
import { BarElement } from '@mui/x-charts-pro/BarChart';
// or
import { BarElement } from '@mui/x-charts-pro';
// or
import { BarElement } from '@mui/x-charts-premium/BarChart';
// or
import { BarElement } from '@mui/x-charts-premium';

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

Props

NameTypeDefaultDescription
color*string-
dataIndex*number-
height*number-
layout*'horizontal'
| 'vertical'
-
seriesId*string-
skipAnimation*bool-
width*number-
x*number-
xOrigin*number-
y*number-
yOrigin*number-
classesPartial-

See CSS classes API below for more details.

hiddenbool-
slotPropsBarElementSlotProps{}

The props used for each component slot.

slotsBarElementSlots{}

Overridable component slots.

See Slots API below for more details.

The component cannot hold a ref.

Slots

Slot nameClass nameDefault componentDescription
barBarElementPathThe component that renders the bar.

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.