Skip to Content
Overlays & Dialogs@hacline/ui/drawer

Drawer

A draggable overlay panel that slides out from the edge of the screen.

Usage

Open the delivery details, then dismiss via the close button, Escape, or dragging downward. Specify the screen edge with side and configure stop positions with snapPoints.

Opening from the Right

Set side="right" to display side panel details. Focus management and closing with Escape remain supported.

Parts

PartDescriptionExtended Props
DrawerBackdrop
A dim behind the drawer. Its opacity follows the drawer, so give it a color like bg-black/20.
variant
DrawerClose
A button that closes the drawer. An action runs first, and a Promise it returns keeps the drawer open until it settles.—
DrawerContent
The sheet itself, a dialog. It renders inside a full-screen viewport the drawer positions it in.—
DrawerDescription
Describes the drawer while it's rendered. A paragraph by default.—
DrawerHandle
The grabber. Pressing it moves to the next snap point; arrow keys, Home and End step. Name it, like aria-label="Resize".—
DrawerOutlet
An element that follows the drawer, like the page behind it: it plays its keyframes as the drawer expands and gets the --drawer-* variables. Outside the drawer, pass the drawer's controller.—
DrawerShortcut
Shows a trigger's shortcut, like ⌘K, inside the trigger. Hidden from screen readers, which hear aria-keyshortcuts.—
DrawerTitle
The drawer's title, which names it. A level 2 heading by default.—
DrawerTrigger
The button that opens the drawer. A trigger outside the drawer, like one per table row, connects through controller.—

Props

Prop

Type

View parts and state attributes in UI SDK.