diff --git a/docs/pages/material-ui/api/popper.json b/docs/pages/material-ui/api/popper.json index f8dbd99d5a1b72..292d8c77a6a0d0 100644 --- a/docs/pages/material-ui/api/popper.json +++ b/docs/pages/material-ui/api/popper.json @@ -8,9 +8,13 @@ } }, "children": { "type": { "name": "union", "description": "node
| func" } }, - "components": { "type": { "name": "shape", "description": "{ Root?: elementType }" } }, + "components": { + "type": { "name": "shape", "description": "{ Root?: elementType }" }, + "default": "{}" + }, "componentsProps": { - "type": { "name": "shape", "description": "{ root?: func
| object }" } + "type": { "name": "shape", "description": "{ root?: func
| object }" }, + "default": "{}" }, "container": { "type": { "name": "union", "description": "HTML element
| func" } }, "disablePortal": { "type": { "name": "bool" } }, @@ -25,19 +29,25 @@ "type": { "name": "enum", "description": "'auto-end'
| 'auto-start'
| 'auto'
| 'bottom-end'
| 'bottom-start'
| 'bottom'
| 'left-end'
| 'left-start'
| 'left'
| 'right-end'
| 'right-start'
| 'right'
| 'top-end'
| 'top-start'
| 'top'" - } + }, + "default": "'bottom'" }, "popperOptions": { "type": { "name": "shape", "description": "{ modifiers?: array, onFirstUpdate?: func, placement?: 'auto-end'
| 'auto-start'
| 'auto'
| 'bottom-end'
| 'bottom-start'
| 'bottom'
| 'left-end'
| 'left-start'
| 'left'
| 'right-end'
| 'right-start'
| 'right'
| 'top-end'
| 'top-start'
| 'top', strategy?: 'absolute'
| 'fixed' }" - } + }, + "default": "{}" }, "popperRef": { "type": { "name": "custom", "description": "ref" } }, "slotProps": { - "type": { "name": "shape", "description": "{ root?: func
| object }" } + "type": { "name": "shape", "description": "{ root?: func
| object }" }, + "default": "{}" + }, + "slots": { + "type": { "name": "shape", "description": "{ root?: elementType }" }, + "default": "{}" }, - "slots": { "type": { "name": "shape", "description": "{ root?: elementType }" } }, "sx": { "type": { "name": "union", diff --git a/packages/mui-material/src/Popper/Popper.tsx b/packages/mui-material/src/Popper/Popper.tsx index e62ece2792ba94..1b500984f979bf 100644 --- a/packages/mui-material/src/Popper/Popper.tsx +++ b/packages/mui-material/src/Popper/Popper.tsx @@ -49,11 +49,13 @@ const Popper = React.forwardRef(function Popper( ref: React.ForwardedRef, ) { const theme = useTheme<{ direction?: Direction }>(); - const { components, componentsProps, slots, slotProps, ...other } = useThemeProps({ + const props = useThemeProps({ props: inProps, name: 'MuiPopper', }); + const { components, componentsProps, slots, slotProps, ...other } = props; + const RootComponent = slots?.root ?? components?.Root; return (