Select

A dropdown menu similar to the HTML <select> element. Options are provided as an array of MenuOption types, and v-model is used to bind the current selection's value.

Demos

Basic Usage

Options must have a value, and can have a label to display in the UI. If no label is provided (like the third option in this example), the value will be displayed.

With custom label display

The label scoped slot enables you to customize the display of the label, with bindings for the selectedOption and the defaultLabel.

With custom option display

The menu-option scoped slot enables you to customize the display of each option, with a binding for the option.

Usage

Props

Prop nameDescriptionTypeValuesDefault
optionsMenu options. See the MenuOption type.MenuOption[]-
modelValueValue provided by v-model binding in the parent component.string|number|null-null
defaultLabelLabel to display when no selection has been made.string-''
disabledWhether the dropdown is disabled.boolean-false

Events

Event namePropertiesDescription
update:modelValuevalue string | number - The new valueWhen the selection value changes.

Slots

NameDescriptionBindings
labelDisplay of the current selection or default labelselectedOption MenuOption, undefined - The currently selected option
defaultLabel string - The default label, provided via a prop
menu-optionDisplay of an individual option in the menuoption MenuOption - The current option

Last updated: