Basic
Action menu with common items.
Composable action menus with nested content, selection states, and rich items.
Import the component and configure it with the same props used in the playground.
Common patterns and practical usage examples.
Action menu with common items.
Organizes related actions with labels and dividers.
Adds icons, badges, and shortcuts to clarify actions.
Filter menu items.
Uses checkbox and radio menu items for temporary preferences.
Nests secondary actions when the web menu has more choices.
Loading menu state.
Disabled trigger state.
Props available for the React Dropdown.
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | - | Controlled open state. |
defaultOpen | boolean | - | Initial open state for uncontrolled usage. |
onOpenChange | ( | - | Called when the open state changes. |
size | 'sm' | 'md' | Controls the trigger and item size. |
color | 'primary' | 'primary' | Semantic color palette for the dropdown trigger and active items. |
disabled | boolean | false | Disables trigger interaction. |
loading | boolean | false | Shows loading content instead of regular items. |
closeOnSelect | boolean | true | Controls whether the dropdown closes after an item is selected. |
searchable | boolean | false | Enables filtering through a search field. |
command | boolean | false | Enables command-style keyboard and search behavior. |
searchValue | string | - | Controlled search query. |
defaultSearchValue | string | - | Initial search query for uncontrolled usage. |
searchPlaceholder | string | - | Placeholder shown in the search field. |
onSearch | ( | - | Called when the search query changes. |
childrenRequired | ReactNode | - | Trigger, content, and optional compound dropdown children. |
placement | 'top' | - | Floating content placement relative to the trigger. |
strategy | 'absolute' | - | CSS positioning strategy used by the floating content. |
offset | number | 8 | Distance between the trigger and dropdown content. |
collisionPadding | number | - | Padding used when avoiding viewport collisions. |
matchTriggerWidth | boolean | - | Matches dropdown content width to the trigger width. |
minWidth | string | - | Minimum dropdown content width. |
maxWidth | string | - | Maximum dropdown content width. |
portal | boolean | true | Renders dropdown content through a portal. |
avoidCollisions | boolean | true | Allows the dropdown to flip or shift to stay visible. |
modal | boolean | false | Uses modal interaction semantics while the dropdown is open. |
loop | boolean | true | Allows keyboard navigation to wrap between first and last items. |
className | string | - | Class name applied to the root element. |
loadingText | ReactNode | - | Content shown while dropdown items are loading. |
empty | ReactNode | - | Content shown when no items match the current query. |
| Prop | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Disables trigger interaction. |
childrenRequired | ReactNode | - | Trigger content. |
asChild | boolean | - | Composes trigger behavior onto a single child element. |
className | string | - | Class name applied to the trigger element. |
| Prop | Type | Default | Description |
|---|---|---|---|
command | boolean | false | Enables command-style content behavior. |
children | ReactNode | - | Dropdown item and slot content. |
className | string | - | Class name applied to the content element. |
style | CSSProperties | - | Inline style applied to the content element. |
| Prop | Type | Default | Description |
|---|---|---|---|
placeholder | string | - | Placeholder shown in the search field. |
aria-label | string | - | Accessible name for the search input. |
className | string | - | Class name applied to the search input. |
| Prop | Type | Default | Description |
|---|---|---|---|
color | 'default' | 'primary' | Semantic color palette for the item. |
disabled | boolean | false | Disables item interaction. |
closeOnSelect | boolean | true | Overrides whether selecting this item closes the dropdown. |
childrenRequired | ReactNode | - | Item label or custom item content. |
asChild | boolean | - | Composes item behavior onto a single child element. |
icon | ReactNode | - | Icon rendered before the item label. |
description | ReactNode | - | Supporting text rendered below the item label. |
badge | ReactNode | - | Badge content rendered after the item label. |
shortcut | ReactNode | - | Keyboard shortcut hint rendered after the item label. |
onSelect | ( | - | Called when this item is selected. |
href | string | - | Link target rendered when the item acts as an anchor. |
target | import( | - | Anchor target used when href is provided. |
rel | string | - | Anchor rel attribute used when href is provided. |
download | string | - | Anchor download attribute used when href is provided. |
className | string | - | Class name applied to the item element. |
| Prop | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Disables item interaction. |
closeOnSelect | boolean | true | Overrides whether selecting this item closes the dropdown. |
asChild | boolean | - | Composes checkbox item behavior onto a single child element. |
checked | boolean | - | Controlled checked state. |
defaultChecked | boolean | - | Initial checked state for uncontrolled usage. |
onCheckedChange | ( | - | Called when the checked state changes. |
icon | ReactNode | - | Indicator icon shown when the item is checked. |
shortcut | ReactNode | - | Keyboard shortcut hint rendered after the item label. |
childrenRequired | ReactNode | - | Checkbox item label or custom content. |
className | string | - | Class name applied to the checkbox item element. |
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Radio item children. |
value | string | - | Controlled selected radio value. |
defaultValue | string | - | Initial selected radio value for uncontrolled usage. |
onValueChange | ( | - | Called when the selected radio value changes. |
| Prop | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Disables item interaction. |
closeOnSelect | boolean | true | Overrides whether selecting this item closes the dropdown. |
childrenRequired | ReactNode | - | Radio item label or custom content. |
asChild | boolean | - | Composes radio item behavior onto a single child element. |
valueRequired | string | - | Value represented by this radio item. |
icon | ReactNode | - | Indicator icon shown when the item is selected. |
shortcut | ReactNode | - | Keyboard shortcut hint rendered after the item label. |
className | string | - | Class name applied to the radio item element. |
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Grouped dropdown items. |
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Label content for a dropdown group. |
className | string | - | Class name applied to the label element. |
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Class name applied to the separator element. |
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Submenu trigger and content. |
| Prop | Type | Default | Description |
|---|---|---|---|
target | import( | - | Anchor target used when href is provided. |
color | 'default' | 'primary' | Semantic color palette for the item. |
disabled | boolean | false | Disables item interaction. |
closeOnSelect | boolean | true | Overrides whether selecting this item closes the dropdown. |
childrenRequired | ReactNode | - | Item label or custom item content. |
asChild | boolean | - | Composes item behavior onto a single child element. |
icon | ReactNode | - | Icon rendered before the item label. |
description | ReactNode | - | Supporting text rendered below the item label. |
badge | ReactNode | - | Badge content rendered after the item label. |
shortcut | ReactNode | - | Keyboard shortcut hint rendered after the item label. |
href | string | - | Link target rendered when the item acts as an anchor. |
rel | string | - | Anchor rel attribute used when href is provided. |
download | string | - | Anchor download attribute used when href is provided. |
className | string | - | Class name applied to the item element. |
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Submenu item and slot content. |
className | string | - | Class name applied to the submenu content element. |
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Icon slot content. |
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Description slot content. |
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Badge slot content. |
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Shortcut slot content. |
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Empty state content. |
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Loading state content. |
Guidance for accessible usage and interaction.
childrenaria-labelloopmodalopendisabledcolorcheckedvalueonValueChange