|
1
|
--- |
|
2
|
generate_toc: true |
|
3
|
--- |
|
4
|
|
|
5
|
import { ComponentExample } from "@/components/ComponentExample" |
|
6
|
import { ComponentReference } from "@/components/ComponentReference" |
|
7
|
|
|
8
|
export const metadata = { |
|
9
|
title: `Drawer`, |
|
10
|
} |
|
11
|
|
|
12
|
# {metadata.title} |
|
13
|
|
|
14
|
A component for rendering a sliding panel that overlays the main content. |
|
15
|
|
|
16
|
In this guide, you'll learn how to use the Drawer component. |
|
17
|
|
|
18
|
<ComponentExample name="drawer-demo" /> |
|
19
|
|
|
20
|
## Usage |
|
21
|
|
|
22
|
```tsx |
|
23
|
import { Drawer } from "@medusajs/ui" |
|
24
|
``` |
|
25
|
|
|
26
|
```tsx |
|
27
|
<Drawer> |
|
28
|
<Drawer.Trigger>Trigger</Drawer.Trigger> |
|
29
|
<Drawer.Content> |
|
30
|
<Drawer.Header> |
|
31
|
<Drawer.Title>Drawer Title</Drawer.Title> |
|
32
|
</Drawer.Header> |
|
33
|
<Drawer.Body>Body</Drawer.Body> |
|
34
|
<Drawer.Footer>Footer</Drawer.Footer> |
|
35
|
</Drawer.Content> |
|
36
|
</Drawer> |
|
37
|
``` |
|
38
|
|
|
39
|
--- |
|
40
|
|
|
41
|
## API Reference |
|
42
|
|
|
43
|
<ComponentReference mainComponent="Drawer" componentsToShow={[ |
|
44
|
"Drawer", |
|
45
|
"Drawer.Trigger", |
|
46
|
"Drawer.Content", |
|
47
|
"Drawer.Header", |
|
48
|
"Drawer.Title", |
|
49
|
"Drawer.Body", |
|
50
|
"Drawer.Footer" |
|
51
|
]} /> |
|
52
|
|
|
53
|
--- |
|
54
|
|
|
55
|
## Examples |
|
56
|
|
|
57
|
### Drawer with Form |
|
58
|
|
|
59
|
This example shows a simple form inside a Drawer, demonstrating how to use form elements and handle submission. |
|
60
|
|
|
61
|
<ComponentExample name="drawer-form" hideFeedback /> |