DropdownMenu
Trigger-activated dropdown with menu items
Start Here
Start from the smallest working snippet, then move to interactive examples and the full API contract below.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { DropdownMenu } from '@dryui/ui';
</script>
<DropdownMenu.Root>
<DropdownMenu.Trigger>
<Button variant="ghost">Menu</Button>
</DropdownMenu.Trigger>
<DropdownMenu.Content>
<DropdownMenu.Item onclick={handleEdit}>Edit</DropdownMenu.Item>
<DropdownMenu.Item onclick={handleDelete}>Delete</DropdownMenu.Item>
</DropdownMenu.Content>
</DropdownMenu.Root>Import options
Root package
import { DropdownMenu } from '@dryui/ui'Per-component subpath
import { DropdownMenu } from '@dryui/ui/dropdown-menu'Customize
Use the interactive examples to see common variants, states, and composition patterns before building your own.
Dropdown Menu with groups and separators
<DropdownMenu.Root>
<DropdownMenu.Trigger>
<Button variant="outline">Options</Button>
</DropdownMenu.Trigger>
<DropdownMenu.Content>
<DropdownMenu.Group>
<DropdownMenu.Label>Account</DropdownMenu.Label>
<DropdownMenu.Item>Profile</DropdownMenu.Item>
<DropdownMenu.Item>Settings</DropdownMenu.Item>
<DropdownMenu.Item>Billing</DropdownMenu.Item>
</DropdownMenu.Group>
<DropdownMenu.Separator />
<DropdownMenu.Group>
<DropdownMenu.Item>Support</DropdownMenu.Item>
<DropdownMenu.Item disabled>API (coming soon)</DropdownMenu.Item>
</DropdownMenu.Group>
<DropdownMenu.Separator />
<DropdownMenu.Item>Log out</DropdownMenu.Item>
</DropdownMenu.Content>
</DropdownMenu.Root>Structure
Compound components always start with DropdownMenu.Root. Use this structure block to understand required wrappers before you wire state or styling.
DropdownMenu.Root
DropdownMenu.Trigger
DropdownMenu.Content
DropdownMenu.Item Compose
The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.
Compound component. Start with DropdownMenu.Root, then add only the parts you need.
DropdownMenu.Root
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
open | boolean | false | — | — |
children | Snippet | — | ✓ | — |
Also accepts standard HTML attributes (class, style, id, etc.)
DropdownMenu.Trigger
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
DropdownMenu.Content
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
offset | number | — | — | — |
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
DropdownMenu.Item
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
disabled | boolean | — | — | — |
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
DropdownMenu.Separator
| Prop | Type | Default | Required | Bindable |
|---|
Forwards <div> attributes via rest props. Common examples: id, style, role.
DropdownMenu.Group
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
DropdownMenu.Label
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.