Drawer
The <Drawer>
component is a flexible UI element used to present additional content is a side-in panel, typically from the edge of the screen. Unlike dialogs, it doesn't block interaction with the rest of the page, making it ideal for non-modal interactions.
Key features of the <Drawer>
component include customizable placemnt, adjustable sizes and abilitly to remain non-modal for uninterrupted page interaction.
Anatomy
A <Drawer>
consists of an optinal title, content, actions. The title provides context for the user, while the content holds the main message or interactive elements like forms. The actions section contains controls such as buttons for confirming or cancelling.

Appearance
The appearance of a component can be customized using the variant
and size
props. These props adjust the visual style and dimensions of the component, available values are based on the active theme.
Property | Type | Description |
---|---|---|
variant | - | The available variants of this component. |
size | xsmall | small | medium | The available sizes of this component. |
Usage
A drawer displays supplemental content without blocking the main page. It should feel lightweight, letting users access extra information or controls while continuing their workflow. Keep content clear and focused so the drawer enhances the task without becoming a distraction.
Use a drawer when
- allowing users to adjust settings or view details without leaving the page,
- keeping the main workflow uninterrupted,
- presenting secondary or supporting content.
Avoid using a drawer when
- needing critical confirmations or desctructive actions,
- having deep navigation or complex multi-step flows,
- the task requires full user attention or focus,
- critical information must be acknowledged before continuing,
Secondary information
When users want more detail about an item without leaving the current view, a drawer is ideal. For instance, clicking on a ticket, order, or user could open a drawer with extended information and actions.
Creation or editing flows
Drawers can host lightweight forms, like adding a new event, editing a profle, or adjusting settings, they let users complete taksks without losing context or navigating away.
Contextual utilities
Drawers can provide utilities like quick help, a chat panel, or notes. These stay “on the side” and don’t interfere with the main content area.
Filter
A common use case for drawers is displaying filter panels. Drawers provide a non-intrusive way to expose filtering options while keeping the main content visible and interactive. This allows users to adjust filters, apply changes, and immediately see updated results without leaving the page, for more information about the filter you can visit Filter pattern.
Placement
The <Drawer>
can be placed on any edge of the screen using placement
prop,, placement should relfect the type of content and user's workflow:
- right(most common): details, contextual utilities.
- left: navigaiton, or menus that help users to swich between different views.
- top: lightweight global actions like notifications, announcements, or system alerts. Best for transient information that needs quick visibility but not long interaction.
- bottom: short confirmation actions, quick reply forms, or pickers. Ideal for focused tasks that don’t require leaving the current screen.
Props
Drawer
aria-describedby?
string;
aria-details?
string;
aria-label?
string;
aria-labelledby?
string;
children?
ReactNode | ((opts: DialogRenderProps) => ReactNode);
closeButton?
boolean;
dir?
string;
hidden?
boolean;
id?
string;
inert?
boolean;
keyboardDismissable?
boolean;
lang?
string;
onAnimationEnd?
AnimationEventHandler<HTMLElement>;
onAnimationEndCapture?
AnimationEventHandler<HTMLElement>;
onAnimationIteration?
AnimationEventHandler<HTMLElement>;
onAnimationIterationCapture?
AnimationEventHandler<HTMLElement>;
onAnimationStart?
AnimationEventHandler<HTMLElement>;
onAnimationStartCapture?
AnimationEventHandler<HTMLElement>;
onAuxClick?
MouseEventHandler<HTMLElement>;
onAuxClickCapture?
MouseEventHandler<HTMLElement>;
onClick?
MouseEventHandler<HTMLElement>;
onClickCapture?
MouseEventHandler<HTMLElement>;
onContextMenu?
MouseEventHandler<HTMLElement>;
onContextMenuCapture?
MouseEventHandler<HTMLElement>;
onDoubleClick?
MouseEventHandler<HTMLElement>;
onDoubleClickCapture?
MouseEventHandler<HTMLElement>;
onGotPointerCapture?
PointerEventHandler<HTMLElement>;
onGotPointerCaptureCapture?
PointerEventHandler<HTMLElement>;
onLostPointerCapture?
PointerEventHandler<HTMLElement>;
onLostPointerCaptureCapture?
PointerEventHandler<HTMLElement>;
onMouseDown?
MouseEventHandler<HTMLElement>;
onMouseDownCapture?
MouseEventHandler<HTMLElement>;
onMouseEnter?
MouseEventHandler<HTMLElement>;
onMouseLeave?
MouseEventHandler<HTMLElement>;
onMouseMove?
MouseEventHandler<HTMLElement>;
onMouseMoveCapture?
MouseEventHandler<HTMLElement>;
onMouseOut?
MouseEventHandler<HTMLElement>;
onMouseOutCapture?
MouseEventHandler<HTMLElement>;
onMouseOver?
MouseEventHandler<HTMLElement>;
onMouseOverCapture?
MouseEventHandler<HTMLElement>;
onMouseUp?
MouseEventHandler<HTMLElement>;
onMouseUpCapture?
MouseEventHandler<HTMLElement>;
onPointerCancel?
PointerEventHandler<HTMLElement>;
onPointerCancelCapture?
PointerEventHandler<HTMLElement>;
onPointerDown?
PointerEventHandler<HTMLElement>;
onPointerDownCapture?
PointerEventHandler<HTMLElement>;
onPointerEnter?
PointerEventHandler<HTMLElement>;
onPointerLeave?
PointerEventHandler<HTMLElement>;
onPointerMove?
PointerEventHandler<HTMLElement>;
onPointerMoveCapture?
PointerEventHandler<HTMLElement>;
onPointerOut?
PointerEventHandler<HTMLElement>;
onPointerOutCapture?
PointerEventHandler<HTMLElement>;
onPointerOver?
PointerEventHandler<HTMLElement>;
onPointerOverCapture?
PointerEventHandler<HTMLElement>;
onPointerUp?
PointerEventHandler<HTMLElement>;
onPointerUpCapture?
PointerEventHandler<HTMLElement>;
onScroll?
UIEventHandler<HTMLElement>;
onScrollCapture?
UIEventHandler<HTMLElement>;
onTouchCancel?
TouchEventHandler<HTMLElement>;
onTouchCancelCapture?
TouchEventHandler<HTMLElement>;
onTouchEnd?
TouchEventHandler<HTMLElement>;
onTouchEndCapture?
TouchEventHandler<HTMLElement>;
onTouchMove?
TouchEventHandler<HTMLElement>;
onTouchMoveCapture?
TouchEventHandler<HTMLElement>;
onTouchStart?
TouchEventHandler<HTMLElement>;
onTouchStartCapture?
TouchEventHandler<HTMLElement>;
onTransitionCancel?
TransitionEventHandler<HTMLElement>;
onTransitionCancelCapture?
TransitionEventHandler<HTMLElement>;
onTransitionEnd?
TransitionEventHandler<HTMLElement>;
onTransitionEndCapture?
TransitionEventHandler<HTMLElement>;
onTransitionRun?
TransitionEventHandler<HTMLElement>;
onTransitionRunCapture?
TransitionEventHandler<HTMLElement>;
onTransitionStart?
TransitionEventHandler<HTMLElement>;
onTransitionStartCapture?
TransitionEventHandler<HTMLElement>;
onWheel?
WheelEventHandler<HTMLElement>;
onWheelCapture?
WheelEventHandler<HTMLElement>;
open?
boolean;
"undefined"
placement?
"top" | "bottom" | "left" | "right";
"right"
role?
"region" |
"search" |
"navigation" |
"form" |
"banner" |
"contentinfo" |
"complementary";
role
property sets the ARIA landmark role for this component,
enhancing accessibility by clarifying its purpose to assistive technologies.
Only ARIA landmark roles (e.g., "complementary", "search", "banner", "navigation")
can be used to ensure proper semantic context. Defaults to "complementary"
for secondary content (e.g., filters, sidebar) that supports the main content."complementary"
slot?
string | null;
null
value indicates that the local props completely override all props received from a parent.translate?
"yes" | "no";
Drawer.Trigger
children
ReactNode;
defaultOpen?
boolean;
onOpenChange?
(isOpen: boolean) => void;
open?
boolean;
"false"