---
productId: material-ui
title: React Divider component
components: Divider
githubLabel: 'scope: divider'
materialDesign: https://m2.material.io/components/dividers
githubSource: packages/mui-material/src/Divider
---
# Divider
The Divider component provides a thin, unobtrusive line for grouping elements to reinforce visual hierarchy.
## Introduction
The Material UI Divider component renders as a dark gray `
` with the corresponding accessibility attributes instead of `
` to adhere to the WAI-ARIA [spec](https://www.w3.org/TR/wai-aria-1.2/#separator).
```tsx
import FormatAlignLeftIcon from '@mui/icons-material/FormatAlignLeft';
import FormatAlignCenterIcon from '@mui/icons-material/FormatAlignCenter';
import FormatAlignRightIcon from '@mui/icons-material/FormatAlignRight';
import FormatBoldIcon from '@mui/icons-material/FormatBold';
import Box from '@mui/material/Box';
import Divider, { dividerClasses } from '@mui/material/Divider';
export default function VerticalDividers() {
return (
);
}
```
### Flex item
Use the `flexItem` prop to display the Divider when it's being used in a flex container.
```tsx
import FormatBoldIcon from '@mui/icons-material/FormatBold';
import FormatItalicIcon from '@mui/icons-material/FormatItalic';
import Box from '@mui/material/Box';
import Divider from '@mui/material/Divider';
export default function FlexDivider() {
return (
);
}
```
### With children
Use the `textAlign` prop to align elements that are wrapped by the Divider.
```tsx
import { styled } from '@mui/material/styles';
import Divider from '@mui/material/Divider';
import Chip from '@mui/material/Chip';
const Root = styled('div')(({ theme }) => ({
width: '100%',
...theme.typography.body2,
color: (theme.vars || theme).palette.text.secondary,
'& > :not(style) ~ :not(style)': {
marginTop: theme.spacing(2),
},
}));
export default function DividerText() {
const content = (
{`Lorem ipsum dolor sit amet, consectetur adipiscing elit.`}
);
return (
{content}
CENTER
{content}
LEFT
{content}
RIGHT
{content}
{content}
);
}
```
## Customization
### Use with a List
When using the Divider to separate items in a List, use the `component` prop to render it as an `
`—otherwise it won't be a valid HTML element.
```tsx
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText';
import Divider from '@mui/material/Divider';
const style = {
p: 0,
width: '100%',
maxWidth: 360,
borderRadius: 2,
border: '1px solid',
borderColor: 'divider',
backgroundColor: 'background.paper',
};
export default function ListDividers() {
return (
);
}
```
### Icon grouping
The demo below shows how to combine the props `variant="middle"` and `orientation="vertical"`.
```tsx
import Card from '@mui/material/Card';
import Divider, { dividerClasses } from '@mui/material/Divider';
import FormatAlignLeftIcon from '@mui/icons-material/FormatAlignLeft';
import FormatAlignCenterIcon from '@mui/icons-material/FormatAlignCenter';
import FormatAlignRightIcon from '@mui/icons-material/FormatAlignRight';
import FormatBoldIcon from '@mui/icons-material/FormatBold';
export default function VerticalDividerMiddle() {
return (
);
}
```
## Accessibility
Due to its implicit role of `separator`, the Divider, which is a `
` element, will be announced by screen readers as a "Horizontal Splitter" (or vertical, if you're using the `orientation` prop).
If you're using it as a purely stylistic element, we recommend setting `aria-hidden="true"` which will make screen readers bypass it.
```js
```
If you're using the Divider to wrap other elements, such as text or chips, we recommend changing its rendered element to a plain `` using the `component` prop, and setting `role="presentation"`.
This ensures that it's not announced by screen readers while still preserving the semantics of the elements inside it.
```js
Text element
```
## Anatomy
The Divider component is composed of a root `
`.
```html
```
# Divider API
## Demos
For examples and details on the usage of this React component, visit the component demo pages:
- [Divider](https://mui.com/material-ui/react-divider/)
- [Lists](https://mui.com/material-ui/react-list/)
- [Menubar](https://mui.com/material-ui/react-menubar/)
## Import
```jsx
import Divider from '@mui/material/Divider';
// or
import { Divider } from '@mui/material';
```
## Props
| Name | Type | Default | Required | Description |
|------|------|---------|----------|-------------|
| absolute | `bool` | `false` | No | |
| children | `node` | - | No | |
| classes | `object` | - | No | Override or extend the styles applied to the component. |
| component | `elementType` | - | No | |
| flexItem | `bool` | `false` | No | |
| orientation | `'horizontal' \| 'vertical'` | `'horizontal'` | No | |
| sx | `Array
\| func \| object` | - | No | The system prop that allows defining system overrides as well as additional CSS styles. |
| textAlign | `'center' \| 'left' \| 'right'` | `'center'` | No | |
| variant | `'fullWidth' \| 'inset' \| 'middle' \| string` | `'fullWidth'` | No | |
> **Note**: The `ref` is forwarded to the root element (HTMLHRElement).
> Any other props supplied will be provided to the root element (native element).
## Theme default props
You can use `MuiDivider` to change the default props of this component with the theme.
## CSS
### Rule name
| Global class | Rule name | Description |
|--------------|-----------|-------------|
| - | absolute | Styles applied to the root element if `absolute={true}`. |
| - | flexItem | Styles applied to the root element if `flexItem={true}`. |
| - | fullWidth | Styles applied to the root element if `variant="fullWidth"`. |
| - | inset | Styles applied to the root element if `variant="inset"`. |
| - | middle | Styles applied to the root element if `variant="middle"`. |
| - | root | Styles applied to the root element. |
| - | textAlignLeft | Styles applied to the root element if `textAlign="left" orientation="horizontal"`. |
| - | textAlignRight | Styles applied to the root element if `textAlign="right" orientation="horizontal"`. |
| - | vertical | Styles applied to the root element if `orientation="vertical"`. |
| - | withChildren | Styles applied to the root element if divider have text. |
| - | wrapper | Styles applied to the span children element if `orientation="horizontal"`. |
| - | wrapperVertical | Styles applied to the span children element if `orientation="vertical"`. |
## Source code
If you did not find the information on this page, consider having a look at the implementation of the component for more detail.
- [/packages/mui-material/src/Divider/Divider.js](https://github.com/mui/material-ui/tree/HEAD/packages/mui-material/src/Divider/Divider.js)