While it appear as a modal for tablet and smartphones,
Dropdowns with hoverable
prop won't change it's behavior to avoid any malfunction with hover.
Dropdown
Dropdowns are very versatile, can used as a quick menu or even like a select for discoverable content
Custom trigger
# Content and position
Add the custom
prop to the item to add any type of content.
Add the :focusable="false"
prop to the dropdown-item
if you dont want it to be focusable.
# Links within
Add the has-link
prop to add a anchor tag / router-link, or disabled
to disable an item.
# Customizing with v-model
# Multiple
Add the multiple
prop to select one or more item.
selected: []
# API
Dropdown
Name | Description | Type | Values | Default |
---|---|---|---|---|
v-model | Binding value | Any | — | null |
hoverable | Dropdown will be triggered by hover instead of click | Boolean | — | false |
position | Optional, position of the dropdown relative to the trigger | String | is-top-right , is-top-left , is-bottom-left | Bottom right |
disabled | Disables dropdown | Boolean | — | false |
animation | Custom animation (transition name) | String | — | fade |
inline | Dropdown content (items) are shown inline, trigger is removed | Boolean | — | false |
mobile-modal | Dropdown content (items) are shown into a modal on mobile | Boolean | — | true |
aria-role | Role attribute to be passed to list container for better accessibility. Use menu only in situations where your dropdown is related to navigation menus. | String | list , menu | — |
multiple | Allows multiple selections | Boolean | — | false |
trap-focus | Trap focus inside the dropdown. | Boolean | — | false |
can-close | Can close dropdown by pressing escape or by clicking outside | Boolean, Array | escape , outside | true |
close-on-click | Close dropdown when content is clicked | Boolean | — | true |
Item
Name | Description | Type | Values | Default |
---|---|---|---|---|
value | The value that will be returned on events and v-model | Any | — | null |
separator | Set the item to be a separator | Boolean | — | false |
disabled | Item is disabled | Boolean | — | false |
focusable | Item can be focused | Boolean | — | true |
custom | Item is not a clickable item | Boolean | — | false |
has-link | Use it if your item is an anchor tag or router-link | Boolean | — | false |
paddingless | Remove padding | Boolean | — | false |
aria-role | Role attribute to be passed to list item for better accessibility. Use menuitem only in situations where your dropdown is related to navigation menus. | String | listitem , menuitem | — |
# Variables
You can use these variables to customize this component.
Name | Description | Default |
---|---|---|
$dropdown-mobile-breakpoint | The dropdown will be displayed as a modal below this value. | $desktop |
$dropdown-background-color | Modal background color when the dropdown is shown as a modal. | rgba($black, 0.86) |
$dropdown-disabled-opacity: | Defines dropdown disabled opacity. | 0.5 |
This page is open source. Noticed a typo or something's unclear?