UNPKG

@mui/material

Version:

Quickly build beautiful React apps. MUI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.

84 lines (81 loc) 2.32 kB
import * as React from 'react'; import { SxProps } from '@mui/system'; import { InternalStandardProps as StandardProps, Theme } from '..'; import { ModalProps } from '../Modal'; import { SlideProps } from '../Slide'; import { PaperProps } from '../Paper'; import { TransitionProps } from '../transitions/transition'; import { DrawerClasses } from './drawerClasses'; export interface DrawerProps extends StandardProps<ModalProps, 'open' | 'children'> { /** * Side from which the drawer will appear. * @default 'left' */ anchor?: 'left' | 'top' | 'right' | 'bottom'; /** * The content of the component. */ children?: React.ReactNode; /** * Override or extend the styles applied to the component. */ classes?: Partial<DrawerClasses>; /** * The elevation of the drawer. * @default 16 */ elevation?: number; /** * Props applied to the [`Modal`](/api/modal/) element. * @default {} */ ModalProps?: Partial<ModalProps>; /** * Callback fired when the component requests to be closed. * * @param {object} event The event source of the callback. */ onClose?: ModalProps['onClose']; /** * If `true`, the component is shown. * @default false */ open?: boolean; /** * Props applied to the [`Paper`](/api/paper/) element. * @default {} */ PaperProps?: Partial<PaperProps>; /** * Props applied to the [`Slide`](/api/slide/) element. */ SlideProps?: Partial<SlideProps>; /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx?: SxProps<Theme>; /** * The duration for the transition, in milliseconds. * You may specify a single timeout for all transitions, or individually with an object. * @default { enter: duration.enteringScreen, exit: duration.leavingScreen } */ transitionDuration?: TransitionProps['timeout']; /** * The variant to use. * @default 'temporary' */ variant?: 'permanent' | 'persistent' | 'temporary'; } /** * The props of the [Modal](https://mui.com/api/modal/) component are available * when `variant="temporary"` is set. * * Demos: * * - [Drawers](https://mui.com/components/drawers/) * * API: * * - [Drawer API](https://mui.com/api/drawer/) */ export default function Drawer(props: DrawerProps): JSX.Element;