> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Drawer Component

## Article: Drawer Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/overlays/drawer-component.md

## Article Content:

# Drawer

_Components/Overlays/Drawer_

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

## Overview

```jsx
() => {
  const [open, setOpen] = React.useState(false);
  const [selected, setSelected] = React.useState(null);

  return (
    <Box padding="20px">
      <Button
        priority="secondary"
        size="large"
        prefixIcon={<Icons.ContentFilter />}
        onClick={() => setOpen(true)}
      >
        {' '}
        Filters
      </Button>
      <Drawer margin={true} open={open} onClose={() => setOpen(false)}>
        <Box marginBottom="16px" direction="vertical">
          <Box direction="vertical">
            <ListItemAction
              title="Option One"
              selected={selected === 'option1'}
              onClick={() => setSelected('option1')}
            />
            <ListItemAction
              title="Option Two"
              selected={selected === 'option2'}
              onClick={() => setSelected('option2')}
            />
            <ListItemAction
              title="Option Three"
              selected={selected === 'option3'}
              onClick={() => setSelected('option3')}
            />
          </Box>
        </Box>
      </Drawer>
    </Box>
  );
};
```

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.

```jsx
() => {
  const [open, setOpen] = React.useState(false);
  const [resizable, setResizable] = React.useState(true);

  return (
    <Box direction="vertical">
      <Box gap="10px">
        <Button
          onClick={() => {
            setResizable(true);
            setOpen(true);
          }}
        >
          Open resizable drawer
        </Button>
        <Button
          onClick={() => {
            setResizable(false);
            setOpen(true);
          }}
        >
          Open non-resizable drawer
        </Button>
      </Box>

      <Drawer
        open={open}
        onClose={() => setOpen(false)}
        resizable={resizable}
        backdrop
        margin
        dismissible
      >
        <Box padding="20px" gap="20px" direction="vertical">
          <StorybookComponents.Placeholder height="200px">
            <Text size="medium" weight="normal">
              {resizable ? 'Resizable drawer' : 'Non-resizable drawer'}
            </Text>
          </StorybookComponents.Placeholder>
          <Button onClick={() => setOpen(false)}>Close Drawer</Button>
        </Box>
      </Drawer>
    </Box>
  );
};
```

#### 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.

```jsx
() => {
  const [open, setOpen] = React.useState(false);
  const [backdrop, setBackdrop] = React.useState(true);

  return (
    <Box direction="vertical">
      <Box gap="10px">
        <Button
          onClick={() => {
            setBackdrop(true);
            setOpen(true);
          }}
        >
          Open drawer with backdrop
        </Button>
        <Button
          onClick={() => {
            setBackdrop(false);
            setOpen(true);
          }}
        >
          Open drawer without backdrop
        </Button>
      </Box>

      <Drawer
        open={open}
        onClose={() => setOpen(false)}
        backdrop={backdrop}
        margin
        dismissible
      >
        <Box padding="20px" gap="20px" direction="vertical">
          <StorybookComponents.Placeholder height="200px">
            <Text size="medium" weight="normal">
              {backdrop ? 'With backdrop' : 'Without backdrop'}
            </Text>
          </StorybookComponents.Placeholder>
          <Button onClick={() => setOpen(false)}>Close Drawer</Button>
        </Box>
      </Drawer>
    </Box>
  );
};
```

#### 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.

```jsx
() => {
  const [open, setOpen] = React.useState(false);
  const [margin, setMargin] = React.useState(true);

  return (
    <Box direction="vertical">
      <Box gap="10px">
        <Button
          onClick={() => {
            setMargin(true);
            setOpen(true);
          }}
        >
          Open drawer with margin
        </Button>
        <Button
          onClick={() => {
            setMargin(false);
            setOpen(true);
          }}
        >
          Open drawer without margin
        </Button>
      </Box>

      <Drawer
        open={open}
        onClose={() => setOpen(false)}
        margin={margin}
        backdrop
        dismissible
      >
        <Box padding="20px" gap="20px" direction="vertical">
          <StorybookComponents.Placeholder height="200px">
            <Text size="medium" weight="normal">
              {margin ? 'With margin' : 'Without margin'}
            </Text>
          </StorybookComponents.Placeholder>
          <Button onClick={() => setOpen(false)}>Close Drawer</Button>
        </Box>
      </Drawer>
    </Box>
  );
};
```

#### Header

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.

```jsx
() => {
  const [open, setOpen] = React.useState(false);

  return (
    <Box>
      <Button onClick={() => setOpen(true)}>Open drawer</Button>

      <Drawer open={open} onClose={() => setOpen(false)}>
        <Box direction="vertical">
          <Box
            align="center"
            verticalAlign="middle"
            padding="12px 16px"
            backgroundColor="white"
          >
            <Box width="40px">
              <IconButton
                priority="tertiary"
                skin="dark"
                size="medium"
                onClick={() => setOpen(false)}
              >
                <Icons.X />
              </IconButton>
            </Box>

            <Box flexGrow={1} align="center">
              <Heading size="small">Title</Heading>
            </Box>

            <Box width="40px" align="right">
              <IconButton
                priority="tertiary"
                skin="dark"
                size="medium"
                onClick={() => setOpen(false)}
              >
                <Icons.Check />
              </IconButton>
            </Box>
          </Box>

          <Box padding="20px" direction="vertical" gap="20px">
            <StorybookComponents.Placeholder height="300px">
              <Text size="medium" weight="normal">
                Content goes here
              </Text>
            </StorybookComponents.Placeholder>
          </Box>
        </Box>
      </Drawer>
    </Box>
  );
};
```

## Code

```jsx
import { Drawer } from '@wix/design-system';
```

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `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. |
| `ariaLabelledBy` | `string` | — | Sets the `aria-labelledby` attribute on the drawer content. |
| `backdrop` | `boolean` | `true` | Specifies 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. |
| `dataHook` | `string` | — | Applies a data-hook HTML attribute that can be used in the tests. |
| `dismissible` | `boolean` | `true` | Specifies whether the drawer can be dismissed by clicking outside of it, pressing Esc or dragging it below its lowest snap point. |
| `margin` | `boolean` | `true` | Specifies whether the drawer content box has a margin from the screen edges and rounded bottom corners. |
| `modal` | `boolean` | `true` | When 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. |
| `renderBackdrop` | `boolean` | `true` | Specifies whether the backdrop overlay is rendered at all. When `false`, the overlay element isn't rendered in the DOM. |
| `repositionInputs` | `boolean` | `true` | When 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. |
| `resizable` | `boolean` | `true` | Displays 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. |
| `scrollable` | `boolean` | `true` | Whether 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. |
| `zIndex` | `string & {} \| "-moz-initial" \| "inherit" \| "initial" \| "revert" \| "revert-layer" \| "unset" \| "auto" \| number & {}` | `1000` | Sets the z-index of the drawer and its overlay. |

## Testkit

Import the driver matching your test environment:

```jsx
// UniDriver
import { DrawerUniDriver } from '@wix/design-system/dist/testkit/unidriver';

// Vanilla
import { DrawerTestkit } from '@wix/design-system/dist/testkit';

// Puppeteer
import { DrawerTestkit } from '@wix/design-system/dist/testkit/puppeteer';

// Testing Library
import { DrawerTestkit } from '@wix/design-system/dist/testkit/testing-library';
```

### Driver methods

| Method | Description |
| --- | --- |
| `exists` | Checks whether the component found with the given data hook. |
| `element` | Gets the component root element. |
| `click` | Clicks on the component root element. |
| `base` | Returns 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](invalid-url)) — 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](invalid-url))
- **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](invalid-url))
- **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](invalid-url))
- **1.232.0** (2025-11-28) — fix: add prop to change scrollable wrapper ([#15573](invalid-url))
- **1.232.0** (2025-11-28) — feat: expose a prop repositionInputs ([#15589](invalid-url))
- **1.226.0** (2025-11-10) — feat: add zIndex prop to customize drawer stacking order ([#15484](invalid-url))
- **1.225.0** (2025-11-07) — feat: implement Drawer component with styling and tests ([#15460](invalid-url))