Drawer

Drawer is a neobrutalist React component from Cruise UI. A side panel (left for navigation, right for a cart or filters) that becomes a bottom sheet on phones. Install it with npx shadcn@latest add @cruiseui/drawer.

Install

Terminal

npx shadcn@latest add @cruiseui/drawer

First time? Installation shows the one-off components.json setup (the @cruiseui registry) and how to turn the theme on.

Example

Corners

When to use it

When to use

Navigation on mobile, a cart, filters or details next to the page.

When not to

A yes/no confirmation (use a Modal). Short hints (use a Tooltip).

Props

CruiseDrawer

PropTypeDefaultDescription
titleReactNode——
trigger?ReactElement<unknown, string | JSXElementConstructor<any>>—The button that opens it (gets aria-expanded / aria-controls).
childrenReactNode——
footer?ReactNode—Sticky actions at the bottom.
side?"left" | "right""right"—
sheet?booleanfalse—
open?boolean——
onOpenChange?((open: boolean) => void)——
className?string—Extra classes on the panel, e.g. "nepa-mode" to force dark mode.
initialFocus?RefObject<HTMLElement | null>—What gets focus on open (defaults to the first focusable element).

Accessibility

  • role="dialog" with aria-modal and a title; focus is trapped inside and returns to the opener.
  • Esc, the close button and the backdrop all close it; the page behind doesn't scroll.