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


light

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

The following class names are useful for styling with CSS (the state classes are marked).
To learn more, visit the component customization page.

.MuiDivider-root

Styles applied to the root element.

Rule name:root


.MuiDivider-absolute

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

Rule name:absolute


.MuiDivider-inset

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

Rule name:inset


.MuiDivider-fullWidth

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

Rule name:fullWidth


.MuiDivider-light

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-vertical

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

Rule name:vertical


.MuiDivider-flexItem

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

Rule name:flexItem


.MuiDivider-withChildren

Styles applied to the root element if divider have text.

Rule name:withChildren


.MuiDivider-withChildrenVertical

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

Rule name:withChildrenVertical


.MuiDivider-textAlignRight

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

Rule name:textAlignRight


.MuiDivider-textAlignLeft

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

Rule name:textAlignLeft


.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: