<.dropdown_menu_root id="docs-dropdown-menu-hero">
<.dropdown_menu_trigger>
<.button variant="soft">Options<.dropdown_menu_trigger_icon /></.button>
</.dropdown_menu_trigger>
<.dropdown_menu_content>
<.dropdown_menu_item shortcut="⌘ E">Edit</.dropdown_menu_item>
<.dropdown_menu_item shortcut="⌘ D">Duplicate</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ N">Archive</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item>Share</.dropdown_menu_item>
<.dropdown_menu_item>Add to favorites</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ ⌫" color="red">Delete</.dropdown_menu_item>
</.dropdown_menu_content>
</.dropdown_menu_root>
API Reference
This component inherits props from the Dropdown Menu primitive. Content portals into container (default "body").
Root
Contains all the parts of a dropdown menu.
| Prop | Type | Default | Description |
|---|---|---|---|
class
|
string
|
nil
|
|
default_open
|
boolean
|
false
|
|
dir
|
string
|
"ltr"
|
|
id
|
string
|
nil
|
|
modal
|
boolean
|
true
|
|
on_open_change
|
string
|
nil
|
|
open
|
boolean
|
false
|
|
style
|
string
|
""
|
class
string
Default
nil
default_open
boolean
Default
false
dir
string
Default
"ltr"
id
string
Default
nil
modal
boolean
Default
true
on_open_change
string
Default
nil
open
boolean
Default
false
style
string
Default
""
Trigger
Wraps the control that will open the dropdown menu.
| Prop | Type | Default | Description |
|---|---|---|---|
class
|
string
|
nil
|
|
content_id
|
string
|
nil
|
|
disabled
|
boolean
|
false
|
|
id
|
string
|
nil
|
|
style
|
string
|
""
|
class
string
Default
nil
content_id
string
Default
nil
disabled
boolean
Default
false
id
string
Default
nil
style
string
Default
""
Trigger Icon
An optional icon part for the trigger.
| Prop | Type | Default | Description |
|---|---|---|---|
class
|
string
|
nil
|
class
string
Default
nil
Content
The component that pops out when the dropdown menu is open.
| Prop | Type | Default | Description |
|---|---|---|---|
class
|
string
|
nil
|
|
color
|
string
|
—
|
Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky. |
container
|
string
|
"body"
|
|
high_contrast
|
boolean
|
—
|
Whether to increase color contrast with the background. |
id
|
string
|
nil
|
|
size
|
string
|
"2"
|
|
variant
|
string
|
"solid"
|
class
string
Default
nil
color
Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky.
string
Default
—
container
string
Default
"body"
high_contrast
Whether to increase color contrast with the background.
boolean
Default
—
id
string
Default
nil
size
string
Default
"2"
variant
string
Default
"solid"
Label
Used to render a label. It won't be focusable using arrow keys.
| Prop | Type | Default | Description |
|---|---|---|---|
class
|
string
|
nil
|
class
string
Default
nil
Item
The component that contains the dropdown menu items.
| Prop | Type | Default | Description |
|---|---|---|---|
class
|
string
|
nil
|
|
color
|
string
|
—
|
Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky. |
disabled
|
boolean
|
false
|
|
shortcut
|
string
|
nil
|
|
text_value
|
string
|
nil
|
class
string
Default
nil
color
Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky.
string
Default
—
disabled
boolean
Default
false
shortcut
string
Default
nil
text_value
string
Default
nil
Separator
Visual separator between items.
| Prop | Type | Default | Description |
|---|---|---|---|
class
|
string
|
nil
|
class
string
Default
nil
CheckboxItem
An item that can be controlled and rendered like a checkbox.
| Prop | Type | Default | Description |
|---|---|---|---|
checked
|
boolean
|
false
|
|
class
|
string
|
nil
|
|
color
|
string
|
—
|
Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky. |
disabled
|
boolean
|
false
|
|
shortcut
|
string
|
nil
|
|
text_value
|
string
|
nil
|
checked
boolean
Default
false
class
string
Default
nil
color
Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky.
string
Default
—
disabled
boolean
Default
false
shortcut
string
Default
nil
text_value
string
Default
nil
RadioItem
An item that can be controlled and rendered like a radio.
| Prop | Type | Default | Description |
|---|---|---|---|
checked
|
boolean
|
false
|
|
class
|
string
|
nil
|
|
color
|
string
|
—
|
Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky. |
disabled
|
boolean
|
false
|
|
shortcut
|
string
|
nil
|
|
text_value
|
string
|
nil
|
|
value
|
string
|
""
|
checked
boolean
Default
false
class
string
Default
nil
color
Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky.
string
Default
—
disabled
boolean
Default
false
shortcut
string
Default
nil
text_value
string
Default
nil
value
string
Default
""
Sub
Contains all the parts of a submenu.
| Prop | Type | Default | Description |
|---|---|---|---|
class
|
string
|
nil
|
|
open
|
boolean
|
false
|
class
string
Default
nil
open
boolean
Default
false
SubTrigger
An item that opens a submenu. Must be rendered inside dropdown_menu_sub.
| Prop | Type | Default | Description |
|---|---|---|---|
class
|
string
|
nil
|
|
disabled
|
boolean
|
false
|
|
text_value
|
string
|
nil
|
class
string
Default
nil
disabled
boolean
Default
false
text_value
string
Default
nil
SubContent
The component that pops out when a submenu is open. Must be rendered inside dropdown_menu_sub.
| Prop | Type | Default | Description |
|---|---|---|---|
align
|
string
|
"start"
|
|
class
|
string
|
nil
|
|
color
|
string
|
—
|
Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky. |
high_contrast
|
boolean
|
—
|
Whether to increase color contrast with the background. |
id
|
string
|
nil
|
|
side
|
string
|
"right"
|
|
side_offset
|
integer
|
1
|
|
size
|
string
|
"2"
|
|
variant
|
string
|
"solid"
|
align
string
Default
"start"
class
string
Default
nil
color
Color utility class string. One of: gray, gold, bronze, brown, yellow, amber, orange, tomato, red, ruby, crimson, pink, plum, purple, violet, iris, indigo, blue, cyan, teal, jade, green, grass, lime, mint, sky.
string
Default
—
high_contrast
Whether to increase color contrast with the background.
boolean
Default
—
id
string
Default
nil
side
string
Default
"right"
side_offset
integer
Default
1
size
string
Default
"2"
variant
string
Default
"solid"
Examples
Size
Use the size prop to control the size.
<.flex gap="3" align="center">
<.dropdown_menu_root id="docs-dropdown-menu-size-1">
<.dropdown_menu_trigger>
<.button variant="soft" size="1">Options<.dropdown_menu_trigger_icon /></.button>
</.dropdown_menu_trigger>
<.dropdown_menu_content size="1">
<.dropdown_menu_item shortcut="⌘ E">Edit</.dropdown_menu_item>
<.dropdown_menu_item shortcut="⌘ D">Duplicate</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ N">Archive</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ ⌫" color="red">Delete</.dropdown_menu_item>
</.dropdown_menu_content>
</.dropdown_menu_root>
<.dropdown_menu_root id="docs-dropdown-menu-size-2">
<.dropdown_menu_trigger>
<.button variant="soft" size="2">Options<.dropdown_menu_trigger_icon /></.button>
</.dropdown_menu_trigger>
<.dropdown_menu_content size="2">
<.dropdown_menu_item shortcut="⌘ E">Edit</.dropdown_menu_item>
<.dropdown_menu_item shortcut="⌘ D">Duplicate</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ N">Archive</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ ⌫" color="red">Delete</.dropdown_menu_item>
</.dropdown_menu_content>
</.dropdown_menu_root>
</.flex>
Variant
Use the variant prop to customize the visual style of the dropdown menu.
<.flex gap="3" align="center">
<.dropdown_menu_root id="docs-dropdown-menu-variant-solid">
<.dropdown_menu_trigger>
<.button variant="solid">Options<.dropdown_menu_trigger_icon /></.button>
</.dropdown_menu_trigger>
<.dropdown_menu_content variant="solid">
<.dropdown_menu_item shortcut="⌘ E">Edit</.dropdown_menu_item>
<.dropdown_menu_item shortcut="⌘ D">Duplicate</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ N">Archive</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ ⌫" color="red">Delete</.dropdown_menu_item>
</.dropdown_menu_content>
</.dropdown_menu_root>
<.dropdown_menu_root id="docs-dropdown-menu-variant-soft">
<.dropdown_menu_trigger>
<.button variant="soft">Options<.dropdown_menu_trigger_icon /></.button>
</.dropdown_menu_trigger>
<.dropdown_menu_content variant="soft">
<.dropdown_menu_item shortcut="⌘ E">Edit</.dropdown_menu_item>
<.dropdown_menu_item shortcut="⌘ D">Duplicate</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ N">Archive</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ ⌫" color="red">Delete</.dropdown_menu_item>
</.dropdown_menu_content>
</.dropdown_menu_root>
</.flex>
Color
Use the color prop to assign a specific color. You can also pass color to a specific item for semantic emphasis.
<.flex gap="3" wrap="wrap">
<.dropdown_menu_root id="docs-dropdown-menu-color-indigo">
<.dropdown_menu_trigger>
<.button variant="soft" color="indigo">Options<.dropdown_menu_trigger_icon /></.button>
</.dropdown_menu_trigger>
<.dropdown_menu_content variant="soft" color="indigo">
<.dropdown_menu_item shortcut="⌘ E">Edit</.dropdown_menu_item>
<.dropdown_menu_item shortcut="⌘ D">Duplicate</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ N">Archive</.dropdown_menu_item>
</.dropdown_menu_content>
</.dropdown_menu_root>
<.dropdown_menu_root id="docs-dropdown-menu-color-cyan">
<.dropdown_menu_trigger>
<.button variant="soft" color="cyan">Options<.dropdown_menu_trigger_icon /></.button>
</.dropdown_menu_trigger>
<.dropdown_menu_content variant="soft" color="cyan">
<.dropdown_menu_item shortcut="⌘ E">Edit</.dropdown_menu_item>
<.dropdown_menu_item shortcut="⌘ D">Duplicate</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ N">Archive</.dropdown_menu_item>
</.dropdown_menu_content>
</.dropdown_menu_root>
<.dropdown_menu_root id="docs-dropdown-menu-color-orange">
<.dropdown_menu_trigger>
<.button variant="soft" color="orange">Options<.dropdown_menu_trigger_icon /></.button>
</.dropdown_menu_trigger>
<.dropdown_menu_content variant="soft" color="orange">
<.dropdown_menu_item shortcut="⌘ E">Edit</.dropdown_menu_item>
<.dropdown_menu_item shortcut="⌘ D">Duplicate</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ N">Archive</.dropdown_menu_item>
</.dropdown_menu_content>
</.dropdown_menu_root>
<.dropdown_menu_root id="docs-dropdown-menu-color-crimson">
<.dropdown_menu_trigger>
<.button variant="soft" color="crimson">Options<.dropdown_menu_trigger_icon /></.button>
</.dropdown_menu_trigger>
<.dropdown_menu_content variant="soft" color="crimson">
<.dropdown_menu_item shortcut="⌘ E">Edit</.dropdown_menu_item>
<.dropdown_menu_item shortcut="⌘ D">Duplicate</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ N">Archive</.dropdown_menu_item>
</.dropdown_menu_content>
</.dropdown_menu_root>
</.flex>
High-contrast
Use the high_contrast prop to increase color contrast with the background.
<.grid columns="2" gap="3">
<.dropdown_menu_root id="docs-dropdown-menu-hc-solid-off">
<.dropdown_menu_trigger>
<.button color="gray">Options<.dropdown_menu_trigger_icon /></.button>
</.dropdown_menu_trigger>
<.dropdown_menu_content color="gray">
<.dropdown_menu_item shortcut="⌘ E">Edit</.dropdown_menu_item>
<.dropdown_menu_item shortcut="⌘ D">Duplicate</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ N">Archive</.dropdown_menu_item>
</.dropdown_menu_content>
</.dropdown_menu_root>
<.dropdown_menu_root id="docs-dropdown-menu-hc-solid-on">
<.dropdown_menu_trigger>
<.button color="gray" high_contrast>Options<.dropdown_menu_trigger_icon /></.button>
</.dropdown_menu_trigger>
<.dropdown_menu_content color="gray" high_contrast>
<.dropdown_menu_item shortcut="⌘ E">Edit</.dropdown_menu_item>
<.dropdown_menu_item shortcut="⌘ D">Duplicate</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ N">Archive</.dropdown_menu_item>
</.dropdown_menu_content>
</.dropdown_menu_root>
<.dropdown_menu_root id="docs-dropdown-menu-hc-soft-off">
<.dropdown_menu_trigger>
<.button color="gray" variant="soft">Options<.dropdown_menu_trigger_icon /></.button>
</.dropdown_menu_trigger>
<.dropdown_menu_content color="gray" variant="soft">
<.dropdown_menu_item shortcut="⌘ E">Edit</.dropdown_menu_item>
<.dropdown_menu_item shortcut="⌘ D">Duplicate</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ N">Archive</.dropdown_menu_item>
</.dropdown_menu_content>
</.dropdown_menu_root>
<.dropdown_menu_root id="docs-dropdown-menu-hc-soft-on">
<.dropdown_menu_trigger>
<.button color="gray" variant="soft" high_contrast>
Options<.dropdown_menu_trigger_icon />
</.button>
</.dropdown_menu_trigger>
<.dropdown_menu_content color="gray" variant="soft" high_contrast>
<.dropdown_menu_item shortcut="⌘ E">Edit</.dropdown_menu_item>
<.dropdown_menu_item shortcut="⌘ D">Duplicate</.dropdown_menu_item>
<.dropdown_menu_separator />
<.dropdown_menu_item shortcut="⌘ N">Archive</.dropdown_menu_item>
</.dropdown_menu_content>
</.dropdown_menu_root>
</.grid>