Drawer

An off-canvas panel for filters, carts or settings that springs in from either side of the screen over a blurred backdrop, stops the page behind it from scrolling, and closes on Escape or a backdrop click unless dismissable is turned off.

Preview

Drawer preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/drawer
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

open
boolean
—
onOpenChange
(open: boolean) => void
—
side?
"left" | "right"
right
className?
string

Class for the panel surface.

—
backdropClassName?
string

Class for the backdrop.

—
ariaLabel?
string
—
dismissable?
boolean

Close when the backdrop is clicked. Default true.

true

Updated