Skip to content

Divider API

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

Component demos

Import

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

Props

Props of the native component are also available.

absolute

Absolutely position the element.

Type:bool

Default:false


children

The content of the component.

Type:node


classes

Override or extend the styles applied to the component.

See CSS API below for more details.

Type:object


component

The component used for the root node. Either a string to use a HTML element or a component.

Type:elementType


flexItem

If true, a vertical divider will have the correct height when used in flex container. (By default, a vertical divider will have a calculated height of 0px if it is the child of a flex container.)

Type:bool

Default:false


lightDeprecated

If true, the divider will have a lighter color.

Type:bool

Default:false


orientation

The component orientation.

Type:'horizontal'
| 'vertical'

Default:'horizontal'


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


textAlign

The text alignment.

Type:'center'
| 'left'
| 'right'

Default:'center'


variant

The variant to use.

Type:'fullWidth'
| 'inset'
| 'middle'
| string

Default:'fullWidth'


The ref is forwarded to the root element.

Theme default props

You can use MuiDivider 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.

.MuiDivider-absolute

Styles applied to the root element if absolute={true}.

Rule name:absolute


.MuiDivider-flexItem

Styles applied to the root element if flexItem={true}.

Rule name:flexItem


.MuiDivider-fullWidth

Styles applied to the root element if variant="fullWidth".

Rule name:fullWidth


.MuiDivider-inset

Styles applied to the root element if variant="inset".

Rule name:inset


.MuiDivider-lightDeprecated

Styles applied to the root element if light={true}.

Rule name:light


.MuiDivider-middle

Styles applied to the root element if variant="middle".

Rule name:middle


.MuiDivider-root

Styles applied to the root element.

Rule name:root


.MuiDivider-textAlignLeft

Styles applied to the root element if textAlign="left" orientation="horizontal".

Rule name:textAlignLeft


.MuiDivider-textAlignRight

Styles applied to the root element if textAlign="right" orientation="horizontal".

Rule name:textAlignRight


.MuiDivider-vertical

Styles applied to the root element if orientation="vertical".

Rule name:vertical


.MuiDivider-withChildren

Styles applied to the root element if divider have text.

Rule name:withChildren


.MuiDivider-withChildrenVerticalDeprecated

Styles applied to the root element if divider have text and orientation="vertical".

Rule name:withChildrenVertical


.MuiDivider-wrapper

Styles applied to the span children element if orientation="horizontal".

Rule name:wrapper


.MuiDivider-wrapperVertical

Styles applied to the span children element if orientation="vertical".

Rule name:wrapperVertical



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