# Drawer

> Bottom sheet / drawer for mobile-friendly panels.

Registry name: `drawer`. HTML docs: https://ui.anuragroy.dev/component/drawer.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/drawer.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/drawer.json`.

Registry JSON: https://ui.anuragroy.dev/r/drawer.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/drawer.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

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

## Usage

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

export function Example() {
  return (
    <Drawer>
      <DrawerTrigger render={<Button />}>Open drawer</DrawerTrigger>
      <DrawerContent>
        <DrawerHeader>
          <DrawerTitle>Drawer</DrawerTitle>
          <DrawerDescription>A bottom sheet panel.</DrawerDescription>
        </DrawerHeader>
        <DrawerFooter>
          <DrawerClose render={<Button variant="outline" />}>Close</DrawerClose>
        </DrawerFooter>
      </DrawerContent>
    </Drawer>
  )
}
```

## API

### Drawer

Base UI Dialog configured as a bottom sheet.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open` | boolean | — |  |
| `onOpenChange` | (open: boolean) => void | — |  |

### DrawerContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `showHandle` | boolean | true | Drag handle at the top of the sheet. |

## See also

- [HTML page](https://ui.anuragroy.dev/component/drawer): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/drawer.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
