---
title: Drawer
description: A drawer component for React.
base: base
component: true
links:
doc: https://base-ui.com/react/components/drawer
---
## About
Drawer uses Base UI for swipe gestures, nested drawers, and snap points.
## Installation
CommandManual
```bash
npx shadcn@latest add @rescript-shadcn/Drawer
```
Install the following dependencies:
```bash
npm install @base-ui/react rescript-base-ui cn
```
Copy and paste the following code into your project.
## Usage
```res showLineNumbers
}>
{"Open Drawer"->React.string}
{"Are you absolutely sure?"->React.string} {"This action cannot be undone."->React.string} }>
{"Cancel"->React.string}
```
## Examples
### Scrollable Content
Keep actions visible while the content scrolls.
### Sides
Use `swipeDirection` to set the drawer’s dismissal direction: `Up`, `Right`, `Down` (the default), or `Left`.
### Nested drawers
### Non-modal
### Snap points
### Swipe handle
### Responsive Dialog
You can combine the `Dialog` and `Drawer` components to create a responsive dialog. This renders a `Dialog` component on desktop and a `Drawer` on mobile.
## API Reference
See the [Base UI documentation](https://base-ui.com/react/components/drawer) for the full API reference.