Skip to content

Dropdown Menu

Dropdown menus display a list of actions or selectable options that appear when a user clicks a trigger element. They are commonly used in toolbars, table rows, navigation, and anywhere you need to present a compact set of choices without taking up permanent screen space.

Loading Code Block...

The default configuration renders a dropdown menu with a custom trigger and a set of options. Clicking the trigger toggles the menu open and closed.

Loading Code Block...

Enable the built-in search input to allow users to filter through options. Use to activate it.

Loading Code Block...

Control the horizontal alignment of the dropdown relative to its trigger using the align prop. Supported values are start, center, and end.

The position prop controls which side of the trigger the dropdown opens from. Supported values are top, bottom, left, and right.

Loading Code Block...

Set disabled to prevent the dropdown from being triggered. The trigger element receives reduced opacity and pointer-events: none.

Loading Code Block...

Control the dropdown width with the width prop. Use the interactive demo below to see the difference between automatic and fixed sizing:

  • "content" (default): Allows the dropdown panel to naturally auto-size based on its content (longest option or trigger element).
  • number: Forces a fixed pixel width (e.g., 300) regardless of the content size.

Use the offset prop to adjust the gap (in pixels) between the dropdown panel and its trigger element. The default is 4.

Enable multi-select mode with the multiple prop. When active, each option renders a checkbox and the menu stays open after selection. The onSelect callback returns an array of selected values.

Loading Code Block...

Render a right-aligned element on each option row — useful for keyboard shortcuts, badges, or status indicators. Each row uses justify-between for proper left/right alignment.

Loading Code Block...

Set option.disabled: true to dim a single row and exclude it from keyboard focus and selection. Useful for context-sensitive actions that aren’t currently available.

Loading Code Block...

For full control over a single row’s markup — multi-line layouts, badges, custom typography — render each option yourself.

Loading Code Block...

Use to replace the default options list with fully custom content. When , the options, showSearch, and multiple props are ignored.

Loading Code Block...

You can control the dropdown’s open/close state externally with .

Loading Code Block...

  • The trigger element has aria-expanded and aria-haspopup="true" attributes.
  • The dropdown panel uses role="menu" and individual options use role="menuitem".
  • Keyboard navigation is supported:
  • When disabled is true, .
  • Search input events are stopped from propagating to prevent the menu from closing while typing.
  • Multi-select toggle. In multiple mode, clicking a selected option correctly removes it from the selection (and clicking an unselected option adds it). All selection logic operates on the bound value / v-model directly.
  • Search resets on close. When the menu closes, the inline search input is cleared so re-opening always shows the full options list.
  • onClick bypasses selection. Options with an onClick handler invoke that handler and close the menu without mutating the dropdown’s selected value — useful for action-style items in a selection-style dropdown.
  • Disabled options are skipped during keyboard navigation (Arrow keys + Enter) and cannot be selected by click.