Introduction
Dividers separate content into clear groups. They can be used in lists, layouts, and other components to create visual hierarchy.Basic Usage
List Dividers
The divider renders as an<hr> by default. You can save rendering this DOM element by using the divider prop on the ListItem component.
Inset Dividers
Use thevariant="inset" prop to create an inset divider.
Middle Divider
Use thevariant="middle" prop to create a divider with left and right margins.
Dividers with Text
You can render a divider with content by passing children to the Divider component.Text Alignment
Use thetextAlign prop to control the alignment of the divider content.
Vertical Dividers
You can render a vertical divider using theorientation="vertical" prop. Note that vertical dividers have a calculated height of 0px by default. Use the flexItem prop to display correctly in flex containers.
Vertical Divider with Text
You can also render a vertical divider with content.Props
Divider Props
| Prop | Type | Default | Description |
|---|---|---|---|
absolute | boolean | false | Absolutely position the element. |
children | node | - | The content of the component. |
classes | object | - | Override or extend the styles applied to the component. |
flexItem | boolean | false | If true, a vertical divider will have the correct height when used in flex container. |
light | boolean | false | Deprecated. If true, the divider will have a lighter color. Use sx={{ opacity: 0.6 }} instead. |
orientation | 'horizontal' | 'vertical' | 'horizontal' | The component orientation. |
sx | SxProps<Theme> | - | The system prop for defining CSS overrides and additional styles. |
textAlign | 'center' | 'left' | 'right' | 'center' | The text alignment. |
variant | 'fullWidth' | 'inset' | 'middle' | 'fullWidth' | The variant to use. |
CSS Classes
The following CSS classes are available for customization:.MuiDivider-root- Styles applied to the root element..MuiDivider-absolute- Styles applied to the root element ifabsolute={true}..MuiDivider-inset- Styles applied to the root element ifvariant="inset"..MuiDivider-fullWidth- Styles applied to the root element ifvariant="fullWidth"..MuiDivider-middle- Styles applied to the root element ifvariant="middle"..MuiDivider-flexItem- Styles applied to the root element ifflexItem={true}..MuiDivider-vertical- Styles applied to the root element iforientation="vertical"..MuiDivider-withChildren- Styles applied to the root element ifchildrenis provided..MuiDivider-withChildrenVertical- Styles applied to the root element ifchildrenandorientation="vertical"..MuiDivider-textAlignRight- Styles applied to the root element iftextAlign="right"..MuiDivider-textAlignLeft- Styles applied to the root element iftextAlign="left"..MuiDivider-wrapper- Styles applied to the wrapper element ifchildrenis provided..MuiDivider-wrapperVertical- Styles applied to the wrapper element ifchildrenandorientation="vertical".
Accessibility
Dividers are purely presentational and don’t require specific accessibility considerations. The component renders as an<hr> element by default, which has the implicit ARIA role of separator.