overlaysstable

Dropdown

Composable action menus with nested content, selection states, and rich items.

Documentation
Preview
Live
Size
Color
Options

Usage

Import the component and configure it with the same props used in the playground.

tsx

Examples

Common patterns and practical usage examples.

Basic

Action menu with common items.

tsx

Groups and separators

Organizes related actions with labels and dividers.

tsx

Item adornments

Adds icons, badges, and shortcuts to clarify actions.

tsx

Searchable

Filter menu items.

tsx

Selectable items

Uses checkbox and radio menu items for temporary preferences.

tsx

Submenu

Nests secondary actions when the web menu has more choices.

tsx

Loading

Loading menu state.

tsx

Disabled

Disabled trigger state.

tsx

API

Props available for the React Dropdown.

104 props

Dropdown

PropTypeDefaultDescription
open
boolean-Controlled open state.
defaultOpen
boolean-Initial open state for uncontrolled usage.
onOpenChange
((open: boolean) => void)-Called when the open state changes.
size
'sm' | 'md' | 'lg''md'Controls the trigger and item size.
color
'primary' | 'neutral' | 'success' | 'warning' | 'danger''primary'Semantic color palette for the dropdown trigger and active items.
disabled
booleanfalseDisables trigger interaction.
loading
booleanfalseShows loading content instead of regular items.
closeOnSelect
booleantrueControls whether the dropdown closes after an item is selected.
searchable
booleanfalseEnables filtering through a search field.
command
booleanfalseEnables 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
((value: string) => void)-Called when the search query changes.
childrenRequired
ReactNode-Trigger, content, and optional compound dropdown children.
placement
'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end'-Floating content placement relative to the trigger.
strategy
'absolute' | 'fixed'-CSS positioning strategy used by the floating content.
offset
number8Distance 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 | number-Minimum dropdown content width.
maxWidth
string | number-Maximum dropdown content width.
portal
booleantrueRenders dropdown content through a portal.
avoidCollisions
booleantrueAllows the dropdown to flip or shift to stay visible.
modal
booleanfalseUses modal interaction semantics while the dropdown is open.
loop
booleantrueAllows 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.

Dropdown.Trigger

PropTypeDefaultDescription
disabled
booleanfalseDisables 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.

Dropdown.Content

PropTypeDefaultDescription
command
booleanfalseEnables 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.

Dropdown.Search

PropTypeDefaultDescription
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.

Dropdown.Item

PropTypeDefaultDescription
color
'default' | 'primary' | 'success' | 'warning' | 'danger''primary'Semantic color palette for the item.
disabled
booleanfalseDisables item interaction.
closeOnSelect
booleantrueOverrides 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
((event: DropdownSelectEvent) => void)-Called when this item is selected.
href
string-Link target rendered when the item acts as an anchor.
target
import("react").HTMLAttributeAnchorTarget-Anchor target used when href is provided.
rel
string-Anchor rel attribute used when href is provided.
download
string | boolean-Anchor download attribute used when href is provided.
className
string-Class name applied to the item element.

Dropdown.CheckboxItem

PropTypeDefaultDescription
disabled
booleanfalseDisables item interaction.
closeOnSelect
booleantrueOverrides 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
((checked: boolean) => void)-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.

Dropdown.RadioGroup

PropTypeDefaultDescription
children
ReactNode-Radio item children.
value
string-Controlled selected radio value.
defaultValue
string-Initial selected radio value for uncontrolled usage.
onValueChange
((value: string) => void)-Called when the selected radio value changes.

Dropdown.RadioItem

PropTypeDefaultDescription
disabled
booleanfalseDisables item interaction.
closeOnSelect
booleantrueOverrides 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.

Dropdown.Group

PropTypeDefaultDescription
children
ReactNode-Grouped dropdown items.

Dropdown.Label

PropTypeDefaultDescription
children
ReactNode-Label content for a dropdown group.
className
string-Class name applied to the label element.

Dropdown.Separator

PropTypeDefaultDescription
className
string-Class name applied to the separator element.

Dropdown.Sub

PropTypeDefaultDescription
children
ReactNode-Submenu trigger and content.

Dropdown.SubTrigger

PropTypeDefaultDescription
target
import("react").HTMLAttributeAnchorTarget-Anchor target used when href is provided.
color
'default' | 'primary' | 'success' | 'warning' | 'danger''primary'Semantic color palette for the item.
disabled
booleanfalseDisables item interaction.
closeOnSelect
booleantrueOverrides 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 | boolean-Anchor download attribute used when href is provided.
className
string-Class name applied to the item element.

Dropdown.SubContent

PropTypeDefaultDescription
children
ReactNode-Submenu item and slot content.
className
string-Class name applied to the submenu content element.

Dropdown.ItemIcon

PropTypeDefaultDescription
children
ReactNode-Icon slot content.

Dropdown.ItemDescription

PropTypeDefaultDescription
children
ReactNode-Description slot content.

Dropdown.ItemBadge

PropTypeDefaultDescription
children
ReactNode-Badge slot content.

Dropdown.ItemShortcut

PropTypeDefaultDescription
children
ReactNode-Shortcut slot content.

Dropdown.Empty

PropTypeDefaultDescription
children
ReactNode-Empty state content.

Dropdown.Loading

PropTypeDefaultDescription
children
ReactNode-Loading state content.

Accessibility

Guidance for accessible usage and interaction.

Trigger naming

Use trigger content that clearly communicates the menu purpose.
childrenaria-label

Keyboard menu behavior

Preserve arrow-key navigation, Escape dismissal, and focus return to the trigger.
loopmodalopen

Item states

Use disabled and color state to communicate unavailable or destructive actions.
disabledcolor

Selection patterns

Use checkbox and radio items only when menu selections remain understandable from their labels.
checkedvalueonValueChange

Related components

Explore components that are commonly used alongside this one.