diff --git a/docs/pages/api/divider.md b/docs/pages/api/divider.md
index 056aae3f7af56b..d351e37865c7b4 100644
--- a/docs/pages/api/divider.md
+++ b/docs/pages/api/divider.md
@@ -27,6 +27,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
| absolute | bool | false | Absolutely position the element. |
| classes | object | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |
| component | elementType | 'hr' | The component used for the root node. Either a string to use a DOM element or a component. |
+| flexItem | bool | false | If `true`, the divider will apply adapt to a parent flex container. |
| light | bool | false | If `true`, the divider will have a lighter color. |
| orientation | 'horizontal'
| 'vertical' | 'horizontal' | The divider orientation. |
| variant | 'fullWidth'
| 'inset'
| 'middle' | 'fullWidth' | The variant to use. |
@@ -48,6 +49,7 @@ Any other props supplied will be provided to the root element (native element).
| light | .MuiDivider-light | Styles applied to the root element if `light={true}`.
| middle | .MuiDivider-middle | Styles applied to the root element if `variant="middle"`.
| vertical | .MuiDivider-vertical | Styles applied to the root element if `orientation="vertical"`.
+| flexItem | .MuiDivider-flexItem | Styles applied to the root element if `flexItem={true}`.
You can override the style of the component thanks to one of these customization points:
diff --git a/docs/src/pages/components/dividers/VerticalDividers.js b/docs/src/pages/components/dividers/VerticalDividers.js
index 2045deb2a86d8c..b35859e1fc26f5 100644
--- a/docs/src/pages/components/dividers/VerticalDividers.js
+++ b/docs/src/pages/components/dividers/VerticalDividers.js
@@ -17,7 +17,7 @@ const useStyles = makeStyles(theme => ({
backgroundColor: theme.palette.background.paper,
color: theme.palette.text.secondary,
'& svg': {
- margin: theme.spacing(2),
+ margin: theme.spacing(1.5),
},
'& hr': {
margin: theme.spacing(0, 0.5),
@@ -29,14 +29,16 @@ export default function VerticalDividers() {
const classes = useStyles();
return (
-
{
props: P & {
absolute?: boolean;
+ flexItem?: boolean;
light?: boolean;
orientation?: 'horizontal' | 'vertical';
variant?: 'fullWidth' | 'inset' | 'middle';
diff --git a/packages/material-ui/src/Divider/Divider.js b/packages/material-ui/src/Divider/Divider.js
index 68d99b39391b57..43fdb19561e431 100644
--- a/packages/material-ui/src/Divider/Divider.js
+++ b/packages/material-ui/src/Divider/Divider.js
@@ -38,6 +38,11 @@ export const styles = theme => ({
height: '100%',
width: 1,
},
+ /* Styles applied to the root element if `flexItem={true}`. */
+ flexItem: {
+ alignSelf: 'stretch',
+ height: 'auto',
+ },
});
const Divider = React.forwardRef(function Divider(props, ref) {
@@ -46,6 +51,7 @@ const Divider = React.forwardRef(function Divider(props, ref) {
classes,
className,
component: Component = 'hr',
+ flexItem = false,
light = false,
orientation = 'horizontal',
role = Component !== 'hr' ? 'separator' : undefined,
@@ -60,6 +66,7 @@ const Divider = React.forwardRef(function Divider(props, ref) {
{
[classes[variant]]: variant !== 'fullWidth',
[classes.absolute]: absolute,
+ [classes.flexItem]: flexItem,
[classes.light]: light,
[classes.vertical]: orientation === 'vertical',
},
@@ -91,6 +98,10 @@ Divider.propTypes = {
* Either a string to use a DOM element or a component.
*/
component: PropTypes.elementType,
+ /**
+ * If `true`, the divider will apply adapt to a parent flex container.
+ */
+ flexItem: PropTypes.bool,
/**
* If `true`, the divider will have a lighter color.
*/
diff --git a/packages/material-ui/src/Divider/Divider.test.js b/packages/material-ui/src/Divider/Divider.test.js
index 7b92499316dfa3..deccaaf9405e77 100644
--- a/packages/material-ui/src/Divider/Divider.test.js
+++ b/packages/material-ui/src/Divider/Divider.test.js
@@ -37,6 +37,11 @@ describe('