PatternAvailable

Drawer

A touch-friendly panel with a swipe handle and explicit close action.

Loading example…

Installation

Add the component and its dependencies from the registry running on your computer.

terminal
npx shadcn@latest add https://brutallab.facilito.dev/r/drawer.json

Usage

Import the component into your project and keep the source code under your control.

tsx
'use client';

import {
  Drawer,
  DrawerTrigger,
  DrawerContent,
  DrawerHeader,
  DrawerTitle,
  DrawerDescription,
  DrawerFooter,
  DrawerClose,
} from '@/components/ui/drawer';
import { Button } from '@/components/ui/button';

export default function Demo() {
  return (
    <Drawer>
      <DrawerTrigger render={<Button variant="outline" />}>
        Open drawer
      </DrawerTrigger>
      <DrawerContent>
        <DrawerHeader>
          <DrawerTitle>Workspace details</DrawerTitle>
          <DrawerDescription>
            Review this example and close it when you are done.
          </DrawerDescription>
        </DrawerHeader>
        <div className="p-4 bl-type-body">
          BrutalLab workspace · 12 components
        </div>
        <DrawerFooter>
          <DrawerClose render={<Button />}>Done</DrawerClose>
        </DrawerFooter>
      </DrawerContent>
    </Drawer>
  );
}

States & interaction

Appearance, behavior and keyboard checks.

  • Check closed, open, highlighted, selected and disabled states where supported.
  • Dialogs and menus must open from the keyboard. Escape closes non-persistent overlays and returns focus to the trigger. Tooltips and hover cards must also appear on focus.
  • Test the example with Tab and Shift+Tab. Focus must stay visible in both themes.

API Reference

BrutalLab-specific properties. Native attributes are supported as well.

PropTypeDefaultDescription
booleanuncontrolledControls panel visibility.
function—Reports requests to open or close.

Accessibility

Rules that should remain intact when adapting the component to a product.

Provide a title, description, and an explicit close action. Base UI manages modal focus and return to the trigger.

Retain keyboard focus styles and test the composition with keyboard navigation.

Use className for visual customization; preserve the primitive ARIA attributes.