Skip to content

Drawer API

API reference docs for the React Drawer component. Learn about the props, CSS, and other APIs of this exported module.



import Drawer from '@mui/material/Drawer';
// or
import { Drawer } from '@mui/material';

Learn about the difference by reading this guide on minimizing bundle size.

The props of the Modal component are available when variant="temporary" is set.


Props of the native component are also available.

| 'left'
| 'right'
| 'top'

Side from which the drawer will appear.


The content of the component.


Override or extend the styles applied to the component.

See CSS classes API below for more details.


The elevation of the drawer.


If true, the backdrop is not rendered.


Props applied to the Modal element.


Callback fired when the component requests to be closed. The reason parameter can optionally be used to control the response to onClose.

Signature:function(event: object, reason: string) => void
  • event The event source of the callback.
  • reason Can be: "escapeKeyDown", "backdropClick".

If true, the component is shown.


Props applied to the Paper element.


Props applied to the Slide element.

| 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.

| { appear?: number, enter?: number, exit?: number }
{ enter: theme.transitions.duration.enteringScreen, exit: theme.transitions.duration.leavingScreen, }

The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object.

| 'persistent'
| 'temporary'

The variant to use.

The ref is forwarded to the root element.

Theme default props

You can use MuiDrawer to change the default props of this component with the theme.

CSS classes

These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.

Class nameRule nameDescription
.MuiDrawer-dockeddockedStyles applied to the root element if variant="permanent or persistent".
.MuiDrawer-modalmodalStyles applied to the Modal component.
.MuiDrawer-paperpaperStyles applied to the Paper component.
.MuiDrawer-paperAnchorBottompaperAnchorBottomStyles applied to the Paper component if anchor="bottom".
.MuiDrawer-paperAnchorDockedBottompaperAnchorDockedBottomStyles applied to the Paper component if anchor="bottom" and variant is not "temporary".
.MuiDrawer-paperAnchorDockedLeftpaperAnchorDockedLeftStyles applied to the Paper component if anchor="left" and variant is not "temporary".
.MuiDrawer-paperAnchorDockedRightpaperAnchorDockedRightStyles applied to the Paper component if anchor="right" and variant is not "temporary".
.MuiDrawer-paperAnchorDockedToppaperAnchorDockedTopStyles applied to the Paper component if anchor="top" and variant is not "temporary".
.MuiDrawer-paperAnchorLeftpaperAnchorLeftStyles applied to the Paper component if anchor="left".
.MuiDrawer-paperAnchorRightpaperAnchorRightStyles applied to the Paper component if anchor="right".
.MuiDrawer-paperAnchorToppaperAnchorTopStyles applied to the Paper component if anchor="top".
.MuiDrawer-rootrootStyles applied to the root element.

You can override the style of the component using one of these customization options: