Sunflower UI
Search
Copy Code
Light Mode
drawer-demo.tsx
drawer.tsx
Collapse
Reset
Copy Code
Download
Run
1
"use client"
2
3
import {
4
Drawer,
5
DrawerContent,
6
DrawerHeader,
7
DrawerTitle,
8
DrawerTrigger,
9
} from "@/components/ui/drawer"
10
11
export default function DrawerDemo() {
12
return (
13
<div className="w-full min-h-[400px] flex items-center justify-center p-8">
14
<Drawer>
15
<DrawerTrigger className="inline-flex h-8 items-center justify-center rounded-full border border-black/10 bg-transparent px-4 text-xs font-medium transition-colors hover:bg-black/5 dark:border-white/10 dark:text-zinc-50 dark:hover:bg-white/5">
16
Open drawer
17
</DrawerTrigger>
18
<DrawerContent className="h-[96vh]">
19
<div className="max-w-[700px] mx-auto w-full">
20
<DrawerHeader className="p-12 pb-16">
21
<DrawerTitle className="text-xl mb-6">Drawer for React.</DrawerTitle>
22
<div className="space-y-6 text-[14px] text-zinc-500 dark:text-zinc-400">
23
<p>
24
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
25
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
26
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
27
aliquip ex ea commodo consequat.
28
</p>
29
<p>
30
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
31
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
32
proident, sunt in culpa by officia deserunt mollit anim id est laborum.
33
</p>
34
<p>
35
This one is Vaul, the unstyled drawer for React made by Emil Kowalski,
36
restyled with Sunflower's tokens. Drag the handle down to dismiss it, or
37
press Escape. The page behind scales back while it is open.
38
</p>
39
<div className="pt-2">
40
<a href="#" className="inline-flex items-center text-zinc-950 dark:text-zinc-50 hover:underline">
41
<svg className="mr-2 h-3 w-3" fill="none" viewBox="0 0 24 24" stroke="currentColor">
42
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M14 5l7 7m0 0l-7 7m7-7H3" />
43
</svg>
44
Read the Vaul documentation
45
</a>
46
</div>
47
</div>
48
</DrawerHeader>
49
</div>
50
</DrawerContent>
51
</Drawer>
52
</div>
53
)
54
}