You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Drawer is built on top of [Vaul Vue](https://github.com/radix-vue/vaul-vue).
13
+
14
+
## Installation
15
+
16
+
```bash
17
+
npx shadcn-vue@latest add drawer
18
+
```
19
+
20
+
## Usage
21
+
22
+
```vue showLineNumbers
23
+
<script setup lang="ts">
24
+
import {
25
+
Drawer,
26
+
DrawerClose,
27
+
DrawerContent,
28
+
DrawerDescription,
29
+
DrawerFooter,
30
+
DrawerHeader,
31
+
DrawerTitle,
32
+
DrawerTrigger,
33
+
} from '@/components/ui/drawer'
34
+
</script>
35
+
36
+
<template>
37
+
<Drawer>
38
+
<DrawerTrigger>Open</DrawerTrigger>
39
+
<DrawerContent>
40
+
<DrawerHeader>
41
+
<DrawerTitle>Are you absolutely sure?</DrawerTitle>
42
+
<DrawerDescription>This action cannot be undone.</DrawerDescription>
43
+
</DrawerHeader>
44
+
<DrawerFooter>
45
+
<Button>Submit</Button>
46
+
<DrawerClose>
47
+
<Button variant="outline">
48
+
Cancel
49
+
</Button>
50
+
</DrawerClose>
51
+
</DrawerFooter>
52
+
</DrawerContent>
53
+
</Drawer>
54
+
</template>
55
+
```
56
+
57
+
## Examples
58
+
59
+
### Responsive Dialog
60
+
61
+
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.
0 commit comments