- Accordion
- Avatar
- Badge
- Breadcrumb
- Button
- Calendar
- Checkbox
- Combobox
- Container
- CurrencyInput
- DistributionSlider
- Drawer
- Dropdown
- Grid
- Heading
- Image
- Input
- InputGroup
- Label
- Logo
- MapPin
- Modal
- NativeSelect
- NumberInput
- OtpInput
- PhoneInput
- Popover
- Progress
- PropertyCalendar
- RadioGroup
- RadioGroupCards
- ResponsiveModal
- ScrollArea
- SearchBar
- SearchBarFallback
- SearchInput
- Select
- Separator
- Spinner
- Switch
- Tabs
- Text
- Textarea
- Toast
- Toggle
- ToggleGroup
- Tooltip
Drawer
Slide-over panel for contextual content and actions
pnpm add @wandercom/design-system-web
The Drawer component provides both a high-level API and low-level primitives for advanced composition. On mobile, left and right drawers automatically slide from the bottom. A built-in close button is rendered in the top-right corner of the content area.
Use the simplified Drawer component for most use cases:
import { Drawer } from '@wandercom/design-system-web/ui/drawer';
import { Button } from '@wandercom/design-system-web/ui/button';
export function Example() {
return (
<Drawer
trigger={<Button>Open</Button>}
title="Account settings"
description="Manage your account preferences"
primaryAction={{ label: "Save", action: () => console.log("saved") }}
secondaryAction={{ label: "Cancel", action: () => console.log("cancelled") }}
>
<div>Content here</div>
</Drawer>
);
}For advanced composition, use the individual primitives. Note that DrawerClose renders a pre-styled icon button in the top-right corner and is not intended for use as a labeled cancel button.
import {
DrawerRoot,
DrawerTrigger,
DrawerContent,
DrawerHeader,
DrawerFooter,
DrawerTitle,
DrawerDescription,
DrawerClose,
} from '@wandercom/design-system-web/ui/drawer';
import { Button } from '@wandercom/design-system-web/ui/button';
export function Example() {
return (
<DrawerRoot>
<DrawerTrigger render={<Button variant="outline">Open</Button>} />
<DrawerContent>
<DrawerHeader>
<DrawerTitle>Account settings</DrawerTitle>
<DrawerDescription>Manage your account preferences</DrawerDescription>
</DrawerHeader>
<div>Content here</div>
<DrawerFooter>
<Button variant="outline">Cancel</Button>
<Button>Save</Button>
</DrawerFooter>
<DrawerClose />
</DrawerContent>
</DrawerRoot>
);
}Stack drawers by nesting DrawerRoot components. The inner drawer opens on top of the outer one, and each manages its own open/close state independently.
trigger?
title?
description?
direction?
footer?
secondaryAction?
variant?
formId?
children?
open?
onOpenChange?
defaultOpen?
onOpenAutoFocus?
onCloseAutoFocus?
modal?
slots?
className?
direction?
open?
onOpenChange?
defaultOpen?
modal?
render?
className?
overlayClassName?
onOpenAutoFocus?
onCloseAutoFocus?
className?
className?
className?
className?
Renders a pre-styled ghost icon button with an X icon, absolutely positioned in the top-right corner of the drawer.
className?
- Built on Base UI's drawer primitive, which follows WAI-ARIA dialog patterns
- Closes on escape key press and overlay click when modal
- Links title and description via
aria-labelledby/aria-describedby - Returns focus to the trigger element on close
- Supports swipe-to-dismiss gestures matching the drawer direction