UI Siêu Ngon

Drawer

Slide-in panel rendered in a portal. Supports all four edges, multiple sizes, and smooth CSS animations.

Playground
title
placement
size
Hide close ×
Close on backdrop
rounded
const [open, setOpen] = useState(false);

<Button onClick={() => setOpen(true)}>Open Drawer</Button>

<Drawer
  open={open}
  onClose={() => setOpen(false)}
  title="My Drawer"
>
  <p>Drawer body content.</p>
</Drawer>

Placement

Slide in from right (default), left, top, or bottom.

With Footer

Use the footer prop for action buttons.

Sizes

sm, md (default), lg, full.

API

PropertyTypeDefaultDescription
open*booleanControls visibility
onClose*() => voidCalled when the drawer should close
placement"left" | "right" | "top" | "bottom""right"Edge the drawer slides in from
size"sm" | "md" | "lg" | "full""md"Width/height preset
titleReactNodeTitle shown in the drawer header
footerReactNodeContent in the footer area
closeOnBackdropbooleantrueClose on backdrop click
closeOnEscapebooleantrueClose on Escape key
hideCloseButtonbooleanfalseHide the × button
classNamestringExtra class on the drawer panel
bodyClassNamestringExtra class on the body area