Skip to content
On this page

Dropdown

Dropdowns are very versatile, can used as a quick menu or even like a select for discoverable content

Examples

Base

Custom
Show code

Multiple

selected: []

Show code

Scrollable

Show code

Position

Show code

Class props

'Classes applied to the element'
How does the Class props inspector work?
Class propDescriptionPropsSuffixes
disabledClassClass of dropdown when disabled.disabled
expandedClassClass of dropdown when expanded.expanded
inlineClassClass of dropdown menu when inline.inline
itemActiveClassClass of the dropdown item when active.
itemClassClass of the dropdown item.
itemDisabledClassClass of the dropdown item when disabled.disabled
menuActiveClassClass of dropdown menu when active.inline
menuClassClass of the dropdown menu.
🔍 Classes applied have a higher specificity than expected when inlineClass or mobileClass or expandedClass is applied
menuMobileOverlayClassClass of the overlay when on mobile.
👉 Switch to mobile view to see it in action!

🔍 Classes applied have a higher specificity than expected when mobileClass is applied
menuPositionClassClass of dropdown menu position.positiontop-right
top-left
bottom-left
mobileClassClass of dropdown when on mobile.
👉 Switch to mobile view to see it in action!
rootClassClass of the root element.
triggerClassClass of the trigger element.
html
<o-dropdown></o-dropdown>

Props

Prop nameDescriptionTypeValuesDefault
animationCustom animation (transition name)string-
From config:
dropdown: {
  animation: 'fade'
}
appendToBodyAppend dropdown content to bodyboolean-
appendToBodyCopyParentboolean-
ariaRoleRole attribute to be passed to list container for better accessibility. Use menu only in situations where your dropdown is related to navigation menusstringlist, menu, dialognull
canCloseCan close dropdown by pressing escape or by clicking outsidearray|booleanescape, outsidetrue
closeOnClickClose dropdown when content is clickedboolean-true
disabledDropdown disabledboolean-
expandedDropdown will be expanded (full-width)boolean-
inlineDropdown content (items) are shown inline, trigger is removedboolean-
labelTrigger label, unnecessary when trgger slot is usedstring-undefined
maxHeightMax height of dropdown contentstring|number-
From config:
dropdown: {
  maxHeight: 200
}
menuTagDropdown menu tag namestring | Component-
From config:
dropdown: {
  menuTag: 'div'
}
mobileBreakpointMobile breakpoint as max-width valuestring-
mobileModalDropdown content (items) are shown into a modal on mobileboolean-
From config:
dropdown: {
  mobileModal: true
}
multipleAllows multiple selectionsboolean-
overrideboolean-
positionOptional, position of the dropdown relative to the triggerstringtop-right, top-left, bottom-left
scrollableDropdown content will be scrollableboolean-
trapFocusTrap focus inside the dropdown.boolean-
From config:
dropdown: {
  trapFocus: true
}
triggerTabindexSet the tabindex attribute on the dropdown trigger div (-1 to prevent selection via tab key)number-0
triggersDropdown will be triggered by any eventsarrayclick, hover, contextmenu, focus['click']
v-modelstring|number|boolean|object|array-null

Events

Event namePropertiesDescription
update:modelValue
active-change
change

Slots

NameDescriptionBindings
trigger
default
html
<o-dropdown-item></o-dropdown-item>

Props

Prop nameDescriptionTypeValuesDefault
ariaRolestring-''
clickableItem is clickable and emit an eventboolean-true
disabledItem is disabledboolean-
labelItem label, unnecessary when default slot is usedstring-undefined
overrideboolean-
tabindexnumber|string-0
tagDropdown item tag namestring | Component-
From config:
dropdown: {
  itemTag: 'div'
}
valueThe value that will be returned on events and v-modelstring|number|boolean|object|array-

Events

Event namePropertiesDescription
click

Slots

NameDescriptionBindings
default

Sass variables

Current theme ➜ Oruga Base

SASS VariableDefault
$dropdown-disabled-opacity$base-disabled-opacity
$dropdown-item-active-background-color$primary
$dropdown-item-active-color$primary-invert
$dropdown-item-color#000000
$dropdown-item-disabled-opacity$base-disabled-opacity
$dropdown-item-font-size$base-font-size
$dropdown-item-hover-background-color#f5f5f5
$dropdown-item-hover-color#000000
$dropdown-item-line-height$base-line-height
$dropdown-item-padding0.375rem 1rem
$dropdown-item-font-weight400
$dropdown-menu-background#ffffff
$dropdown-menu-border-radius$base-border-radius
$dropdown-menu-box-shadow0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.02)
$dropdown-menu-margin0
$dropdown-menu-padding0.5rem 0 0.5rem 0
$dropdown-menu-width12rem
$dropdown-menu-zindex20
$dropdown-mobile-max-heightcalc(100vh - 120px)
$dropdown-mobile-max-width460px
$dropdown-mobile-overlay-colorrgba(#000000, 0.86)
$dropdown-mobile-overlay-zindex40
$dropdown-mobile-widthcalc(100vw - 40px)
$dropdown-mobile-zindex50

See ➜ 📄 Full scss file

Current theme ➜ Oruga Full

SASS VariableDefault
$dropdown-disabled-opacity$base-disabled-opacity
$dropdown-item-active-background-color$primary
$dropdown-item-active-color$primary-invert
$dropdown-item-color#000000
$dropdown-item-disabled-opacity$base-disabled-opacity
$dropdown-item-font-size$base-font-size
$dropdown-item-hover-background-color#f5f5f5
$dropdown-item-hover-color#000000
$dropdown-item-line-height$base-line-height
$dropdown-item-padding0.375rem 1rem
$dropdown-item-font-weight400
$dropdown-menu-background#ffffff
$dropdown-menu-border-radius$base-border-radius
$dropdown-menu-box-shadow0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.02)
$dropdown-menu-margin0
$dropdown-menu-padding0.5rem 0 0.5rem 0
$dropdown-menu-width12rem
$dropdown-menu-zindex20
$dropdown-mobile-max-heightcalc(100vh - 120px)
$dropdown-mobile-max-width460px
$dropdown-mobile-overlay-colorrgba(#000000, 0.86)
$dropdown-mobile-overlay-zindex40
$dropdown-mobile-widthcalc(100vw - 40px)
$dropdown-mobile-zindex50

See ➜ 📄 Full scss file

Current theme ➜ Bulma

The theme does not have any custom variables for this component.

Current theme ➜ Bootstrap

SASS VariableDefault
$dropdown-menu-zindex$zindex-modal

See ➜ 📄 Full scss file

Released under the MIT License.