Drawer
The Drawer component is a panel that slides out from the edge of the screen. It can be useful when you need users to complete a task or view some details without leaving the current page.
Installation
Usage
Basic Drawer
Editable Example
Accessibility
- When opening the Drawer, focus is trapped inside the Drawer.
- By default, the drawer sets focus on the first focusable element. If the
initialFocusRef
prop is passed, the drawer sets focus on the element with the assignedref
. - After the drawer closes, it'll return focus to the element that triggered it.
Props
Drawer Props
Drawer composes the Modal
component with these extra props:
Name | Type | Default | Description |
---|---|---|---|
isFullHeight | boolean | false | If true and placement is set to top or bottom , the drawer fills the height of the viewport. |
placement | left , right , top , bottom | right | The ref to the initial element to receive focus when the drawer opens. |
Other components
DrawerOverlay
,DrawerFooter
,DrawerHeader
andDrawerBody
composesBox
componentDrawerCloseButton
composesCloseButton