# Drawer

> A panel that slides in from an edge of the screen.

_Updated: 2026-06-04_

A panel that slides in from an edge of the screen.

## Installation

```bash
railbase ui add drawer
```

> [!NOTE]
> `railbase ui add` also copies shared primitives — they ship alongside this component automatically.

## Usage

```tsx
import { Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, DrawerFooter, DrawerClose } from "@/lib/ui/drawer";

<Drawer>
  <DrawerTrigger>Open</DrawerTrigger>
  <DrawerContent>
    <DrawerHeader>
      <DrawerTitle>Title</DrawerTitle>
      <DrawerDescription>Description.</DrawerDescription>
    </DrawerHeader>
    <DrawerFooter><DrawerClose>Close</DrawerClose></DrawerFooter>
  </DrawerContent>
</Drawer>
```

## Anatomy

Exported parts: `Drawer` · `DrawerTrigger` · `DrawerClose` · `DrawerPortal` · `DrawerOverlay` · `DrawerContent` · `DrawerHeader` · `DrawerFooter` · `DrawerTitle` · `DrawerDescription`
