Vue Multi Select Component API

Vue Multi Select API

CoreUI PRO
This component is part of CoreUI PRO – a powerful UI library with over 250 components and 25+ templates, designed to help you build modern, responsive apps faster. Fully compatible with Angular, Bootstrap, React.js, and Vue.js.

Explore the API reference for the Vue Multi Select component and discover how to effectively utilize its props for customization.

On this page

CMultiSelect

jsx
import { CMultiSelect } from '@coreui/vue-pro'

Props

PropertyDefaultType
allowCreateOptions4.9.0+-boolean

Allow users to create options if they are not in the list of options.

ariaChipRemoveLabel6.0.0+'Remove'string, ((label: string) => string)

Names a chip's remove button with the selected option's label: a string has {label} replaced by it, or gets it appended when there is no {label} ("Remove Angular"); a function receives the label and returns the whole name.

ariaCleanerLabel5.13.0+'Clear all selections'string

A string that provides an accessible label for the cleaner button. This label is read by screen readers to describe the action associated with the button.

ariaPickerLabel6.0.0+'Toggle options list'string

A string that provides an accessible label for the indicator button. This label is read by screen readers to describe the action associated with the button.

ariaRemovedAnnouncement6.0.0+'removed'string, ((values: string[]) => string)

Announced after a value is removed through its chip, Backspace or the cleaner. A string follows the removed labels (Angular removed); a function receives them and returns the whole message. A pick in the list is not announced, since the option says it is selected.

ariaSearchLabel5.19.0+'Search'string

Accessible label for the search input (when search is enabled).

ariaTagDeleteLabel5.19.0+Deprecated 6.0.0undefinedstring

Accessible label prefix for a chip's remove button. While it is set, it takes precedence over ariaChipRemoveLabel.

Use ariaChipRemoveLabel instead.

cleanertrueboolean

Enables selection cleaner element.

clearSearchOnSelect4.9.0+-boolean

Clear current search on selecting an item.

container5.7.0+'body'HTMLElement, (() => HTMLElement), string

Appends the dropdown to a specific element. You can pass an HTML element or function that returns a single element. Inside a modal dialog it goes into the dialog instead, because the rest of the page is inert.

defaultValue6.0.0+undefinednumber, string, (number | string)[]

The initial selection for the uncontrolled mode — matched against the option values. Ignored when value is set.

deselectAllLabel5.19.0+'Deselect all'string

Sets the select all button label shown once everything is selected. The button is a toggle: it shows selectAllLabel (and selects all) until everything is selected, then shows deselectAllLabel (and deselects all).

deselectFilteredLabel5.19.0+'Deselect filtered'string

Sets the deselect filtered button label (used with selectAllMode="filtered").

disabled-boolean

Toggle the disabled state for the component.

feedback4.6.0+-string

Provide valuable, actionable feedback.

feedbackInvalid4.6.0+-string

Provide valuable, actionable feedback.

feedbackValid4.6.0+-string

Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, :invalid and :valid.

floatingLabel6.0.0+-string

Renders a floating label inside the field — the component wraps its frame in .form-floating and the text also becomes the field's accessible name.

floatingLabelAlways6.0.0+-boolean

Keeps the floating label floated and the placeholder visible while the field is empty.

Routes typing to the search box from anywhere in the component, so a keystroke never depends on where the focus sits. Set to false to keep it local: the search box then filters only while it has the focus, and typing over the options list jumps to the first option that starts with what was typed, except with search="external", where the list holds only the last results. Needs search.

hideSelectAllOnSearchNoResults5.20.0+trueboolean

Hide the dropdown header with the built-in select all button when a search filter leaves no matching options. Set to false to keep the select all button visible even when there are no results.

id-string

Set the id attribute for the native select element.

indicator'checkbox'string

Sets option style.

invalid4.6.0+Deprecated 6.0.0-boolean

Mark the control invalid.

Use validationState="invalid" instead — invalid is ignored when validationState is set.

label4.6.0+-string

Add a caption for a component.

loading4.9.0+-boolean

When set, the options list is marked busy and shows a row with a spinner and loadingLabel below its options while you fetch them; the options it shows can still be picked.

loadingLabel6.0.0+'Loading…'string

Text of the loading row below the options, announced to screen readers when the shown list starts loading or the list shows up loading.

multipletrueboolean

It specifies that multiple options can be selected at once.

name5.3.0+-string

Name of the native select the selection is submitted under. Without it the selection is not submitted with the form.

options() => [](Option | OptionsGroup)[]

List of option elements.

optionsGroupsSelectable5.19.0+-boolean

Makes each options group label a toggle that selects or deselects the group's visible options. With indicator="checkbox" (and multiple) the label shows a tri-state checkbox indicator (none / all / indeterminate) reflecting the group's selection.

optionsMaxHeight'auto'number, string

Sets maxHeight of options list.

pickerIcontrueboolean

The button that opens the options menu. Set to false to render no button; replace the artwork through the pickerIcon slot.

placeholder'Select...'string

-

required-boolean

When it is present, it indicates that the user must choose a value before submitting the form.

resetSelectionOnOptionsChange5.3.0+-boolean

Empties the selection when the options bring different values, then takes the options marked selected (or the defaultValue values among them), up to selectionLimit; with value set it only requests the empty selection through the change event. For options that depend on another field, so outdated picks do not travel on.

Renders a search box in the control. true filters the options as the user types; 'external' hands the filtering to your code: the component shows the options you pass and reports what the user types through filter-change.

searchNoResultsLabel'No results found'string

Sets the label for no results when filtering.

selectAlltrueboolean

Enables select all button.

selectAllLabel'Select all'string

Sets the select all button label.

selectAllMode5.19.0+'all'string

Determines what the select all button operates on: all options ('all') or only the currently filtered (search-visible) options ('filtered').

selectedLabel() => defaultSelectedLabelCountLabel

Sets the counter selection label: a function (count, total) => string, or a string in which {count} and {total} are replaced. total is the number of options in the list, disabled ones, the ones inside a group and the ones the user created included, so a disabled option shows that not everything is selected, plus any selected value the options lack, so it never falls below count, unless total gives a number of its own.

selectFilteredLabel5.19.0+'Select filtered'string

Sets the select filtered button label (used with selectAllMode="filtered").

selectionLimit5.19.0+nullnumber

Sets the maximum number of options that can be selected. The select all button stays enabled and selects options up to the limit, then toggles to deselect all once the limit is reached. The selectionLimit event fires when a user tries to select more options than allowed.

selectionType'chips'string

Sets the selection style. chips renders the selection as chips; tags is a deprecated name for chips (since 6.0.0).

show6.0.0+undefinedboolean

Control the open state of the dropdown panel. When set, the panel renders what show says and dismiss gestures only emit update:show — nothing closes until the parent flips the prop. Supports the v-model:show binding.

sizeundefinedstring

Size the component small or large.

teleport5.7.0+falseboolean

Generates dropdown menu using Teleport: into the open <dialog> the field sits in, otherwise into body.

text4.6.0+-string

Add helper text to the component.

tooltipFeedback4.6.0+-boolean

Display validation feedback in a styled tooltip.

total6.0.0+-number

Sets {total} of selectedLabel. Leave it out to count the options in the list; with external search give the number of records your data source holds, which the component cannot see.

valid4.6.0+Deprecated 6.0.0-boolean

Mark the control valid.

Use validationState="valid" instead — valid is ignored when validationState is set.

validationState6.0.0+-string

The validation state, rendered as the is-{state} class; 'invalid' also sets aria-invalid. Any custom state declared in the $form-validation-states Sass map is accepted.

value5.11.0+undefinednumber, string, (number | string)[]

The controlled selection — matched against the option values. Pair it with the change event; for the uncontrolled mode use defaultValue instead.

virtualScroller4.8.0+-boolean

Enable virtual scroller for the options list.

visibleDeprecated 6.0.0undefinedboolean

Toggle the visibility of multi select dropdown.

Use show / v-model:show instead — visible is ignored when show is set.

visibleItems4.8.0+10number

Amount of visible items when virtualScroller is set to true.

Events

Event name
change

Execute a function when the user or the component changes the selection: a pick, a native reset of the form, or resetSelectionOnOptionsChange. A selection you give through value, defaultValue or options marked selected does not fire it, unless resetSelectionOnOptionsChange replaced the selection with it. With value set it is a request.

  • selected Option[]
filterChange

Execute a function when the filter value changed.

hide

The callback is fired when the dropdown requests to be hidden.

selectionLimit

Execute a function when the user tries to select more options than allowed by selectionLimit.

show

The callback is fired when the dropdown requests to be shown.

update:show

Emit the requested open state to support the v-model:show binding — a dismiss gesture (Escape, outside click) or any internal toggle.

update:validationState

Emitted with undefined when the user changes the selection, or the form is reset, while validationState (or invalid/valid) is set, to support the v-model:validation-state binding. A given state is a verdict on the selection it was given for.