Drawer

Components/Overlays/Drawer

Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/drawer

Overview

Copy

The <Drawer/> is a mobile‑first component used to display additional options, actions, or content without navigating away from the current screen. It slides up from the bottom of the viewport and is commonly used to expand dropdown lists on mobile, act as an action sheet when opened from popovers, or present any contextual content in a mobile experience.

Do

  • Use it for focused, short tasks, such as choosing an option, confirming an action or making a quick edit.
  • Make it easy to dismiss by swiping down, with a close icon or, when safe, by tapping the overlay.
  • Keep content concise and scannable. Prioritize primary actions and key information.

Don't

  • Don't stack multiple drawers on top of each other or mix it with other heavy overlays.
  • Don't hide critical information that users need to complete the task behind the drawer.
  • Don't make closing ambiguous. Avoid situations where users feel "trapped" in the drawer.
  • Don't overload it with complex or long flows, such as multi-step forms, dense layouts or full-page experiences.

Feature examples

Resizeable

Control if a handle is shown in the component header with resizable prop. When enabled, it allows user to expand or collapse the drawer with a swipe gesture.

Copy

Backdrop

Control whether the drawer displays a backdrop using the backdrop property. By default, clicking the backdrop will close the drawer.

When the backdrop is disabled, you can allow users to interact with the content behind the drawer by turning off the renderBackdrop property. When this property is off, make sure to provide alternative ways to close the drawer so users don't get trapped in it.

Copy

Margin

Control if the drawer has a margin around it with a margin prop. The size of it is fixed and varies per different themes.

Copy

Add header with action when needed. Drawer content is a react.node, so any content can be placed inside of it.

However, when adding a header, stick to the pattern that the close button is on the left, title is in the center and additional actions are on the right side.

Copy

Code

Copy

Props

NameTypeDefaultDescription
anchor"end" | "start" | "top" | "bottom"'bottom'Controls the screen edge the drawer is anchored to and slides in from. start and end follow the reading direction, so start is the left edge in LTR and the right edge in RTL. Snap points, dragging and dismissing follow the same axis.
ariaLabelledBystring—Sets the aria-labelledby attribute on the drawer content.
backdropbooleantrueSpecifies whether the backdrop overlay is colored. When false, the overlay is still present and blocks clicks on the content behind it, but it's invisible.
children (required)ReactNode—Accepts any content to render inside the drawer.
dataHookstring—Applies a data-hook HTML attribute that can be used in the tests.
dismissiblebooleantrueSpecifies whether the drawer can be dismissed by clicking outside of it, pressing Esc or dragging it below its lowest snap point.
marginbooleantrueSpecifies whether the drawer content box has a margin from the screen edges and rounded bottom corners.
modalbooleantrueWhen false, the drawer behaves as a non-modal dialog: focus isn't trapped, and content outside the drawer remains interactive. Set to true to trap focus and block outside interaction.
onClose (required)(open: boolean, reason: DrawerCloseReason) => void—Defines a callback function which is called when the user dismisses the drawer. reason is 'outside-press' when the overlay is clicked, 'escape-key' when the Esc key is pressed, 'drag' when the drawer is dragged below its lowest snap point and 'focus-out' when focus leaves a non-modal drawer. It's called only when dismissible is true.
open (required)boolean—Specifies whether the drawer is open. When false, the drawer content isn't rendered in the DOM.
renderBackdropbooleantrueSpecifies whether the backdrop overlay is rendered at all. When false, the overlay element isn't rendered in the DOM.
repositionInputsbooleantrueWhen true, repositions the drawer upward when the on-screen keyboard appears on mobile, keeping inputs visible. When false, falls back to default browser scroll behavior.
resizablebooleantrueDisplays the drag handle and enables expand and collapse functionality. When enabled, the drawer can also be dragged directly by its content via touch or pen, following the same snap-point and scroll rules as the handle. Mouse drags on the content are left free to select text.
role"article" | "button" | "dialog" | "figure" | "form" | "img" | "link" | "main" | "menu" | "menuitem" | "option" | "search" | "table" | "switch" | "status" | "scrollbar" | "checkbox" | "none" | "list" | string & {} | "alert" | "alertdialog" | "application" | "banner" | "cell" | "columnheader" | "combobox" | "complementary" | "contentinfo" | "definition" | "directory" | "document" | "feed" | "grid" | "gridcell" | "group" | "heading" | "listbox" | "listitem" | "log" | "marquee" | "math" | "menubar" | "menuitemcheckbox" | "menuitemradio" | "navigation" | "note" | "presentation" | "progressbar" | "radio" | "radiogroup" | "region" | "row" | "rowgroup" | "rowheader" | "searchbox" | "separator" | "slider" | "spinbutton" | "tab" | "tablist" | "tabpanel" | "term" | "textbox" | "timer" | "toolbar" | "tooltip" | "tree" | "treegrid" | "treeitem"'dialog'Sets the WAI-ARIA role of the drawer content.
scrollablebooleantrueWhether the drawer content should be wrapped in a scrollable container, by default it is true. If false, the drawer content is rendered as is, without any scrollable container.
snapPoints(string | number)[][1]Sets the heights the drawer snaps to when dragged. A number up to 1 is a fraction of the content height, and a larger number or a string such as '300px' is a height in pixels. The drawer opens at the first snap point.
zIndexstring & {} | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "auto" | number & {}1000Sets the z-index of the drawer and its overlay.

Testkit

Import the driver matching your test environment:

Copy

Driver methods

MethodDescription
existsChecks whether the component found with the given data hook.
elementGets the component root element.
clickClicks on the component root element.
baseReturns UniDriver for the base element.

Changelog

  • 1.339.0 (2026-10-19) — maintenance release, no component-specific changes
  • 1.338.0 (2026-10-15) — maintenance release, no component-specific changes
  • 1.335.0 (2026-10-12) — maintenance release, no component-specific changes
  • 1.332.0 (2026-10-05) — feat: new anchor prop anchors the drawer to the bottom (default), top, start or end edge of the screen. Dragging, snap points and dismissing follow that edge, and start/end swap sides in RTL. (#17273) — has visual changes
  • 1.331.0 (2026-10-01) — maintenance release, no component-specific changes
  • 1.330.3 (2026-09-29) — maintenance release, no component-specific changes
  • 1.325.0 (2026-09-17) — maintenance release, no component-specific changes
  • 1.324.0 (2026-09-14) — maintenance release, no component-specific changes
  • 1.322.0 (2026-09-09) — maintenance release, no component-specific changes
  • 1.310.0 (2026-08-10) — maintenance release, no component-specific changes
  • 1.299.0 (2026-07-17) — feat: enlarge handle hit area and add content dragging (#16550)
  • 1.292.0 (2026-06-22) — maintenance release, no component-specific changes
  • 1.291.0 (2026-06-19) — maintenance release, no component-specific changes
  • 1.288.0 (2026-06-15) — feat: add modal prop to control outside interaction (#16363)
  • 1.280.0 (2026-05-19) — maintenance release, no component-specific changes
  • 1.266.0 (2026-04-07) — maintenance release, no component-specific changes
  • 1.260.0 (2026-03-17) — maintenance release, no component-specific changes
  • 1.247.2 (2026-01-21) — maintenance release, no component-specific changes
  • 1.234.0 (2025-12-03) — feat: add shouldRenderBackdrop property (#15580)
  • 1.232.0 (2025-11-28) — fix: add prop to change scrollable wrapper (#15573)
  • 1.232.0 (2025-11-28) — feat: expose a prop repositionInputs (#15589)
  • 1.226.0 (2025-11-10) — feat: add zIndex prop to customize drawer stacking order (#15484)
  • 1.225.0 (2025-11-07) — feat: implement Drawer component with styling and tests (#15460)

Last updated: 21 October 2026

Did this help?