werkbank
    Preparing search index...

    Function Drawer

    • A sliding panel component that appears from the edge of the screen.

      Parameters

      Returns Element

      A React component representing the drawer.

      The Drawer component is built on top of the Dialog component. It automatically calculates its entrance and exit animations based on its variant and the current document writing mode provided by useWritingMode.

      <Drawer open={isOpen} onClose={() => setIsOpen(false)}>
      <p>This is a drawer</p>
      </Drawer>
      <Drawer
      variant="inlineEnd"
      size="400px"
      open={isOpen}
      onClose={() => setIsOpen(false)}
      >
      <p>A wider drawer on the right</p>
      </Drawer>
      <Drawer
      variant="blockStart"
      size="20vh"
      open={isOpen}
      onClose={() => setIsOpen(false)}
      >
      <p>A drawer sliding down from the top</p>
      </Drawer>