Examples
Default
Without Overlay
Left
Controlled
Top
Props
Drawer
Root component that manages open/close state for a drawer. Wraps Radix Dialog.Root.Whether the default
DrawerOverlay is rendered. When false, modal is automatically set to false as well (unless explicitly overridden) so focus-trap and scroll-lock are disabled.DrawerClose
Closes the drawer when clicked. Can be placed anywhere inside the drawer. A direct re-export of the RadixDialogPrimitive.Close primitive. It accepts all of that primitive’s props, unchanged.
DrawerContent
The panel that slides in from the chosen edge. Renders inside a portal with an overlay backdrop by default. Includes focus-trap,aria-describedby, and Escape-to-close from Radix Dialog.
Whether to render the default
DrawerOverlay behind the content. Set to false to provide your own overlay or omit it entirely.Prefer setting overlay on the Drawer root instead so that modal is also adjusted automatically.The edge from which the drawer slides in.Named
position (rather than side) to avoid confusion with the CSS side concept used by Radix Popover/Tooltip and to better convey the spatial relationship of the drawer to the viewport.Ignored by variant="page", which always rises from the bottom.Controls the maximum extent of the drawer panel. For left/right drawers this sets
max-width; for top/bottom it sets max-height. Ignored by a left/right variant="modal", which is always the 440px modal, and by variant="page", which always runs to the bottom edge.Which view of a multi-step drawer is showing, in navigation order: a higher step is deeper. When set, the children sit in a
MorphPanel, so changing it morphs the panel to the new view’s height and slides the view in from the right going deeper or from the left going back. Use it to turn a sheet into a deeper view in place rather than stacking a second sheet. Children keep their state across steps, and focus moves to the new view’s heading. Leave it unset for a drawer with one view.Keep it a number for as long as the drawer is open: switching between a number and undefined adds or removes the panel and remounts the children. Reset it after the close animation rather than in onOpenChange(false), or the drawer plays a step transition as it closes.Visual treatment of the panel. Use
"sheet" (with position="bottom") for a bottom sheet with the modal surface treatment, "menu" for a floating inset menu carrying the dropdown surface, "modal" for the V2 Modal: beside the page on desktop, from the bottom on mobile, or "page" for a detail page that rises from the bottom over the one behind it.DrawerDescription
An accessible description for the drawer, providing supplementary context.DrawerFooter
A semantic footer area for the drawer, typically containing action buttons. Inside a"modal" drawer it carries no padding of its own, since the panel pads its content.
Takes no props of its own. Accepts all standard div attributes, including className.
DrawerHeader
A semantic header area for the drawer, typically containing a title and description. Renders a built-in close button by default, and a back arrow before the title when givenonBack, for a deeper view of a multi-step drawer. In a drawer with a step, it holds still while the body moves between views (see MorphPanel). Inside a "modal" drawer it carries no padding of its own, since the panel pads its content.
DrawerOverlay
A translucent backdrop rendered behind the drawer content. Clicking the overlay closes the drawer by default.DrawerTitle
An accessible title for the drawer. Required for screen readers.DrawerTrigger
The element that opens the drawer when clicked. On touch / pen, a press-and-release that crosses a small movement threshold is treated as a drag and the resulting synthetic click is suppressed — defends against Android Chrome opening the drawer on a scroll-drag-end.Exported types
Also exported from@fanvue/ui: DrawerCloseProps, DrawerContentProps, DrawerDescriptionProps, DrawerFooterProps, DrawerHeaderProps, DrawerOverlayProps, DrawerPosition, DrawerProps, DrawerSize, DrawerTitleProps, DrawerTriggerProps, DrawerVariant.
Setup: Installation · Theming