Drawer
A drawer is a panel that slides in from the left side of the screen.Caution
We are planning on deprecating Drawer. Please use Modal instead. Drawer should not be used with our new Navigation system
Installation
| Install | yarn add @atlaskit/drawer |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlaskit/drawer, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
Props
Drawer
| Description | Controls whether to focus the first tabbable element inside the focus lock. Set to |
|---|---|
| Type | boolean |
| Description | The content of the drawer. |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
| Description | Sets the direction the draw enters from. The default is "left". |
|---|---|
| Type | "top" | "bottom" | "right" | "left" |
| Description | Enable this to keep focus inside the component until it’s closed. This is strongly recommended, as it prevents people who use assistive technology from accidentally navigating out of the drawer using the tab key. |
|---|---|
| Type | boolean |
| Description | Controls if the drawer is open or closed. |
|---|---|
| Type | boolean |
| Description | This is an |
|---|---|
| Type | string |
| Description | Callback function called when the drawer is closed. |
|---|---|
| Type | (event: React.SyntheticEvent<HTMLElement, Event>, analyticsEvent?: any) => void |
| Description | A callback function that will be called when the drawer has finished its close transition. |
|---|---|
| Type | (node: HTMLElement) => void |
| Description | Callback function called while the drawer is displayed and |
|---|---|
| Type | (event: React.SyntheticEvent<Element, Event>) => void |
| Description | A callback function that will be called when the drawer has finished its opening transition. |
|---|---|
| Type | (node: HTMLElement) => void |
| Description | ReturnFocus controls what happens when the user exits focus lock mode. If true, focus returns to the trigger element . If false, focus remains where it was when the FocusLock was deactivated. If ref is passed, focus returns to that specific ref element. |
|---|---|
| Type | boolean | React.RefObject<HTMLElement> |
| Description | A |
|---|---|
| Type | string |
| Description | This is an ID referenced by the drawer wrapper's |
|---|---|
| Type | string |
| Description | Sets the width of the drawer. |
|---|---|
| Type | "medium" | "narrow" | "wide" | "extended" | "full" |
| Description | Z-index that the popup should be displayed in.
This is passed to the portal component.
Defaults to |
|---|---|
| Type | number | "unset" |
DrawerContent
The main content of the drawer.
| Description | The content of the drawer. |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
| Description | When the content is scrollable, this is the accessible name for the the drawer region. The default is "Scrollable content". |
|---|---|
| Type | string |
| Description | No description. |
|---|---|
| Type | false | (XCSSValue<"backgroundColor" | "marginBlockStart" | "marginTop" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "padding", DesignTokenStyles, ""> & ... 4 more ... & { ...; }) |
The sidebar is positioned adjacent to the main content and is intended to house the close button.
| Description | The content of the sidebar. |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal |
| Description | No description. |
|---|---|
| Type | false | (XCSSValue<"width" | "backgroundColor" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "padding", DesignTokenStyles, ""> & ... 4 more ... & { ...; }) |
An icon button that closes the drawer.
| Description | Use this to render an icon for the drawer close/back control, if it's available. |
|---|---|
| Type | React.ComponentClass<any, any> | React.FunctionComponent<any> |
| Description | This is the accessible name for the close/back control of the drawer. The default is "Close drawer". |
|---|---|
| Default | "Close drawer" |
| Type | string |
| Description | A |
|---|---|
| Default | "DrawerCloseButton" |
| Type | string |