* docs: create a new UI docs project (#13233) * docs: create a new UI docs project * fix installation errors * docs: migrate UI docs content to new project (#13241) * Fix content * added examples for some components * finish adding examples * lint fix * fix build errors * delete empty files * path fixes + refactor * fix build error
61 lines
1.1 KiB
Plaintext
61 lines
1.1 KiB
Plaintext
---
|
|
generate_toc: true
|
|
---
|
|
|
|
import { ComponentExample } from "@/components/ComponentExample"
|
|
import { ComponentReference } from "@/components/ComponentReference"
|
|
|
|
export const metadata = {
|
|
title: `Drawer`,
|
|
}
|
|
|
|
# {metadata.title}
|
|
|
|
A component for rendering a sliding panel that overlays the main content.
|
|
|
|
In this guide, you'll learn how to use the Drawer component.
|
|
|
|
<ComponentExample name="drawer-demo" />
|
|
|
|
## Usage
|
|
|
|
```tsx
|
|
import { Drawer } from "@medusajs/ui"
|
|
```
|
|
|
|
```tsx
|
|
<Drawer>
|
|
<Drawer.Trigger>Trigger</Drawer.Trigger>
|
|
<Drawer.Content>
|
|
<Drawer.Header>
|
|
<Drawer.Title>Drawer Title</Drawer.Title>
|
|
</Drawer.Header>
|
|
<Drawer.Body>Body</Drawer.Body>
|
|
<Drawer.Footer>Footer</Drawer.Footer>
|
|
</Drawer.Content>
|
|
</Drawer>
|
|
```
|
|
|
|
---
|
|
|
|
## API Reference
|
|
|
|
<ComponentReference mainComponent="Drawer" componentsToShow={[
|
|
"Drawer",
|
|
"Drawer.Trigger",
|
|
"Drawer.Content",
|
|
"Drawer.Header",
|
|
"Drawer.Title",
|
|
"Drawer.Body",
|
|
"Drawer.Footer"
|
|
]} />
|
|
|
|
---
|
|
|
|
## Examples
|
|
|
|
### Drawer with Form
|
|
|
|
This example shows a simple form inside a Drawer, demonstrating how to use form elements and handle submission.
|
|
|
|
<ComponentExample name="drawer-form" hideFeedback /> |