import { Meta, Canvas, ArgTypes } from '@storybook/addon-docs/blocks'; import { Drawer } from '@strapi/design-system'; import * as Dialog from '@radix-ui/react-dialog';
import * as DrawerStories from './Drawer.stories';
A dismissible drawer that slides in from an edge of the viewport. Built on Radix UI Dialog for accessibility and keyboard/outside-click dismissal.
import { Drawer } from '@strapi/design-system';Shares Radix Dialog Root component parameters (with an additional headerVisible):
<ArgTypes of={Drawer.Root & Dialog.Root} />
Shares Radix Dialog Trigger component parameters.
The Trigger component uses asChild — it renders the child and merges drawer open/close behaviour onto it.
Shares Radix Dialog Close component parameters.
Uses asChild — wrap a button (or other focusable element) to close the drawer on activation.
Example:
import { Drawer } from '@strapi/design-system';
<Drawer.Close>
<button>Cancel</button>
</Drawer.Close>Use for the drawer heading. Renders as h2 for accessibility.
Optional. Scrollable content area of the drawer (hidden by default when defaultOpen on Drawer.Content is false).
Optional. Flex container for custom actions.
The drawer can be positioned on any edge via the side prop.
With headerVisible on Root, when open is false only the header is visible and the overlay is hidden. A toggle button in the header opens and closes the drawer.
Uses Radix UI Dialog, which implements the Dialog WAI-ARIA pattern. The drawer is dismissible via:
- Escape key
- Click outside (on the overlay)
- Close button in the header (when using
Drawer.Header)