Popover API
API reference docs for the React Popover component. Learn about the props, CSS, and other APIs of this exported module.
Demos
Import
import Popover from '@mui/material/Popover';
// or
import { Popover } from '@mui/material';Learn about the difference by reading this guide on minimizing bundle size.
Props of the Modal component are also available.
| Name | Type | Default | Description |
|---|---|---|---|
| open* | bool | - | If |
| action | ref | - | A ref for imperative actions. It currently only supports updatePosition() action. |
| anchorEl | HTML element | func | - | An HTML element, PopoverVirtualElement, or a function that returns either. It's used to set the position of the popover. |
| anchorOrigin | { horizontal: 'center' | 'left' | 'right' | number, vertical: 'bottom' | 'center' | 'top' | number } | { vertical: 'top', horizontal: 'left', } | This is the point on the anchor where the popover's |
| anchorPosition | { left: number, top: number } | - | This is the position that may be used to set the position of the popover. The coordinates are relative to the application's client area. |
| anchorReference | 'anchorEl' | 'anchorPosition' | 'none' | 'anchorEl' | This determines which anchor prop to refer to when setting the position of the popover. |
| children | node | - | The content of the component. |
| classes | object | - | Override or extend the styles applied to the component. See CSS classes API below for more details. |
| container | HTML element | func | - | An HTML element, component instance, or function that returns either. The |
| disableScrollLock | bool | false | Disable the scroll lock behavior. |
| elevation | integer | 8 | The elevation of the popover. |
| marginThreshold | number | 16 | Specifies how close to the edge of the window the popover can appear. If null, the popover will not be constrained by the window. |
| onClose | func | - | Callback fired when the component requests to be closed. The |
| slotProps | { backdrop?: func | object, paper?: func | object, root?: func | object, transition?: func | object } | {} | The props used for each slot inside. |
| slots | { backdrop?: elementType, paper?: elementType, root?: elementType, transition?: elementType } | {} | The components used for each slot inside. |
| sx | Array<func | object | bool> | func | object | - | The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details. |
| transformOrigin | { horizontal: 'center' | 'left' | 'right' | number, vertical: 'bottom' | 'center' | 'top' | number } | { vertical: 'top', horizontal: 'left', } | This is the point on the popover which will attach to the anchor's origin. |
| transitionDuration | 'auto' | number | { appear?: number, enter?: number, exit?: number } | 'auto' | Set to 'auto' to automatically calculate transition time based on height. |
ref is forwarded to the root element.Inheritance
While not explicitly documented above, the props of the Modal component are also available in Popover. You can take advantage of this to target nested components.
| Slot name | Class name | Default component | Description |
|---|---|---|---|
| root | .MuiPopover-root | Modal | The component used for the root slot. |
| paper | .MuiPopover-paper | Paper | The component used for the paper slot. |
| transition | Grow | The component used for the transition slot. | |
| backdrop | Backdrop | The component used for the backdrop slot. |
Source code
If you did not find the information in this page, consider having a look at the implementation of the component for more detail.