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.

Demos

For examples and details on the usage of this React component, visit the component demo pages:

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.

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.

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

Styles applied to the root element.

.MuiDivider-absoluteabsolute

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

.MuiDivider-insetinset

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

.MuiDivider-fullWidthfullWidth

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

.MuiDivider-lightlight

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

.MuiDivider-middlemiddle

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

.MuiDivider-verticalvertical

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

.MuiDivider-flexItemflexItem

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

.MuiDivider-withChildrenwithChildren

Styles applied to the root element if divider have text.

.MuiDivider-withChildrenVerticalwithChildrenVertical

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

.MuiDivider-textAlignRighttextAlignRight

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

.MuiDivider-textAlignLefttextAlignLeft

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

.MuiDivider-wrapperwrapper

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

.MuiDivider-wrapperVerticalwrapperVertical

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

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