Skip to content

Drawer

Props

API reference for Drawer. For usage examples, see the React tab.

Drawer.Root

NameTypeDefault
children (required)ReactNode
defaultOpenboolean

Whether the overlay is open by default (uncontrolled).

isOpenboolean

Whether the overlay is open by default (controlled).

Drawer.CloseButton

NameTypeDefault
childrenChildrenOrFunction<ButtonRenderProps>

The children of the component. A function may be provided to alter the children based on component state.

fullWidthbooleanfalse

Renders the Button in with a fluid width

isDisabledboolean

Whether the button is disabled.

isPendingboolean

Whether the button is in a pending state. This disables press and hover events while retaining the ability to focus, and announces the pending state to screen readers.

size"lg" | "md" | "sm"md

Determines the size of the Button

variant"destructive" | "primary" | "secondary" | "tertiary"secondary

Variant for the button.

Drawer.Content

NameTypeDefault
childrenReactNode

The content or child elements nested within this component.

Drawer.Footer

NameTypeDefault
childrenReactNode

The content or child elements nested within this component.

Drawer.Overlay

NameTypeDefault
children (required)ReactNode
defaultOpenboolean

Whether the overlay is open by default (uncontrolled).

isDismissablebooleanfalse

Enables the drawer to be closed by clicking outside of the drawer

isEnteringboolean

Whether the modal is currently performing an entry animation.

isExitingboolean

Whether the modal is currently performing an exit animation.

isKeyboardDismissDisabledbooleanfalse

Whether pressing the escape key to close the modal should be disabled.

isOpenboolean

Whether the overlay is open by default (controlled).

UNSTABLE_deferUntilEnteredboolean

Whether to wait until the entry animation completes before hiding content outside the modal and moving focus into it.

UNSTABLE_overrideFocusboolean

Whether to override the focus() method so it does not scroll the page. This is temporary and will be removed after fully testing all overlays.

Drawer.Title

NameTypeDefault
childrenReactNode

The content or child elements nested within this component.

levelnumber3

The heading level.

Drawer.Tray

NameTypeDefault
childrenReactNode
defaultOpenboolean

Whether the overlay is open by default (uncontrolled).

isCloseButtonHiddenbooleanfalse

Removes the close button from the drawer

isDismissablebooleanfalse

Enables the drawer to be closed by clicking outside of the drawer

isEnteringboolean

Whether the modal is currently performing an entry animation.

isExitingboolean

Whether the modal is currently performing an exit animation.

isKeyboardDismissDisabledbooleanfalse

Whether pressing the escape key to close the modal should be disabled.

isOpenboolean

Whether the overlay is open by default (controlled).

position"left" | "right""right"

Which edge of the viewport the drawer is anchored to.

size"lg" | "md" | "sm"'md'

Size of the drawer

UNSTABLE_deferUntilEnteredboolean

Whether to wait until the entry animation completes before hiding content outside the modal and moving focus into it.

UNSTABLE_overrideFocusboolean

Whether to override the focus() method so it does not scroll the page. This is temporary and will be removed after fully testing all overlays.