Skip to content
RefineUI

Drawer

Slide-over panel overlay from screen edge.

Overview

Machine-readable contract from Component Spec.

component: drawerexport: Drawerversion: 1attributes: data-refineui=drawer

Anatomy

Partdata-refineui
rootdrawer

Variants

AxisValues
typeoverlay, inline
sizesm, md, lg

States

ScopeCategoryValues
componentcomponentdata-state: open, closed
componentenvironmentforced-colors, dir
drawercomponentdata-state: open, closed

Accessibility

SlotElementRole
drawerdivdialog

Keyboard

KeyActionNative
Escapeclose—

Focus

SectionPropertyValue
visualrequiredtrue
visualselector:focus-visible
behaviortraptrue
behaviorinitialfirst-focusable
behaviorreturntrigger

Layout

PropertyValue
directionlogical
rtltrue
npm install @refineui/react @refineui/tokens
import {
Drawer,
DrawerTrigger,
DrawerContent,
DrawerHeader,
DrawerTitle,
DrawerDescription,
DrawerBody,
DrawerFooter,
Button
} from "@refineui/react";
const [open, setOpen] = useState(false);
<Drawer open={open} onOpenChange={setOpen}>
<DrawerTrigger asChild>
<Button>Open Drawer</Button>
</DrawerTrigger>
<DrawerContent>
<DrawerHeader>
<DrawerTitle>Settings</DrawerTitle>
<DrawerDescription>Adjust your preferences</DrawerDescription>
</DrawerHeader>
<DrawerBody>
{/* Drawer content */}
</DrawerBody>
<DrawerFooter>
<Button variant="outline" onClick={() => setOpen(false)}>Cancel</Button>
<Button>Save</Button>
</DrawerFooter>
</DrawerContent>
</Drawer>
<Drawer type="inline" placement="left" size="md" showFooter>
{/* Drawer content */}
</Drawer>
PropDefaultTypeDescription
open—booleanControlled open state.
defaultOpen—booleanUncontrolled initial open state.
onOpenChange—(open: boolean) => voidEvent handler when open state changes.
type"overlay""overlay" | "inline"Drawer display type.
placement"right""left" | "right"Side of the screen.
size"md""sm" | "md" | "lg"Drawer width.
showFooterfalsebooleanShows footer section.

Trigger element (usually a Button).

Drawer panel container.

PropDefaultTypeDescription
actions—ReactNodeAdditional header actions.

Drawer heading element.

Drawer description text.

Scrollable content area.

PropDefaultTypeDescription
state—"icons" | "single" | "split"Footer button layout.