245e5c9a69
* added tool to generate spec files for React components * use typedoc for missing descriptions and types * improvements and fixes * improvements * added doc comments for half of the components * add custom resolver + more doc comments * added all tsdocs * general improvements * add specs to UI docs * added github action * remove unnecessary api route * Added readme for react-docs-generator * remove comment * Update packages/design-system/ui/src/components/currency-input/currency-input.tsx Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com> * remove description of aria fields + add generate script --------- Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
47 lines
881 B
Plaintext
47 lines
881 B
Plaintext
---
|
|
title: "Dropdown Menu"
|
|
description: "Displays a menu to the user—such as a set of actions or functions—triggered by a button."
|
|
component: true
|
|
---
|
|
|
|
<ComponentExample name="dropdown-menu-demo" />
|
|
|
|
## Usage
|
|
|
|
---
|
|
|
|
```tsx
|
|
import { DropdownMenu } from "@medusajs/ui"
|
|
```
|
|
|
|
```tsx
|
|
<DropdownMenu>
|
|
<DropdownMenu.Trigger>Trigger</DropdownMenu.Trigger>
|
|
<DropdownMenu.Content>
|
|
<DropdownMenu.Item>Edit</DropdownMenu.Item>
|
|
<DropdownMenu.Item>Add</DropdownMenu.Item>
|
|
<DropdownMenu.Item>Delete</DropdownMenu.Item>
|
|
</DropdownMenu.Content>
|
|
</DropdownMenu>
|
|
```
|
|
|
|
## API Reference
|
|
|
|
---
|
|
|
|
<ComponentReference mainComponent="DropdownMenu" componentsToShow={[
|
|
"DropdownMenu",
|
|
"DropdownMenu.Shortcut",
|
|
"DropdownMenu.Hint",
|
|
]} />
|
|
|
|
## Examples
|
|
|
|
---
|
|
|
|
### Sorting
|
|
|
|
Implementing collection sorting choices using a Dropdown Menu:
|
|
|
|
<ComponentExample name="dropdown-menu-sorting" />
|