Dropdown
Dropdowns are toggleable, contextual overlays for displaying lists of links, actions, or content. They provide a way to display additional options without cluttering the interface.
When to Use
- For action menus with multiple related options
- To save space by hiding secondary actions until needed
- For filter or sort controls in data tables
- For user profile or settings menus in navigation
When Not to Use / Alternatives
- For form selections (use Select component instead)
- When all options should be visible (use Button Group or Tabs)
- For primary navigation (use Navbar with Nav component)
Component Anatomy
- Toggle Button: Triggers the dropdown menu
- Dropdown Menu: Container for dropdown items
- Dropdown Items: Individual actionable items with optional icons
- Dividers (optional): Visual separators between item groups
Basic Usage
With Icons
Enhance dropdown items with Bootstrap Icons for better scannability.
Variants
Use different button variants to match your interface style.
Sizes
Dropdowns come in three sizes to match your interface needs.
Split Button
Split button dropdowns allow a default action with additional options. Use the end prop to align the dropdown menu to the right.
Direction Variations
Control the direction the dropdown menu opens.
Best Practices
- Use clear, action-oriented labels for dropdown items
- Group related actions together using dividers
- Keep dropdown menus concise (5-10 items maximum recommended)
- Use icons to improve scannability and visual hierarchy
- Ensure sufficient color contrast in all theme modes
- Provide keyboard navigation support for accessibility
- Consider using split buttons when there's a primary action
Props
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | IDropDownOption | undefined | Selected option (v-model) |
options | IDropDownOption[] | [] | Array of dropdown options |
placeholder | string | "" | Placeholder text |
variant | ButtonVariant | "outline-secondary" | Button style variant |
size | "xs" | "sm" | "lg" | "xl" | - | Dropdown size |
disabled | boolean | false | Disables the dropdown |
readonly | boolean | false | Makes dropdown readonly |
loading | boolean | false | Shows loading spinner |
hideIcon | boolean | false | Hides the dropdown icon |
placement | PopoverPlacement | "bottom" | Popover position |
hidePopoverOnSubmit | boolean | true | Auto-close on selection |
showControlsHeader | boolean | false | Shows header controls |
teleportTo | string | undefined | Teleport popover target |
Events
| Event | Payload | Description |
|---|---|---|
@update:modelValue | IDropDownOption | Emitted when option is selected |
@click-option | IDropDownOption | Emitted when an option is clicked |
@click | - | Emitted when trigger is clicked |
@focus | - | Emitted on input focus |
@blur | - | Emitted on input blur |
@close-popover | - | Emitted when popover closes |
Exposed Methods
| Method | Description |
|---|---|
openPopover() | Opens the dropdown popover |
hidePopover() | Closes the dropdown popover |
Slots
| Slot | Description |
|---|---|
default | Custom trigger content |
popover-header | Content at top of popover |
popover-footer | Content at bottom of popover |
Accessibility
- Dropdown trigger has
aria-expandedstate aria-haspopupindicates popup behavior- Keyboard: Tab to focus, Enter/Space to open, Arrow keys to navigate options, Escape to close
- Options are focusable with proper
roleattributes