Multiselect
Vue 3 multiselect component with single select, multiselect and tagging options (+Tailwind CSS support).
Install / Use
/learn @vueform/MultiselectREADME
Sponsors
<div align="center"><br> <a href="https://vueform.com?cid=multiselect"><img src="https://github.com/vueform/multiselect/raw/main/assets/logo-horizontal.svg" width="200"></a> </div> <br> <a href="https://vueform.com?cid=multiselect"> <img align="center" src="https://github.com/vueform/multiselect/raw/main/assets/vueform-banner.png" alt="Vueform" title="Vueform"> </a> <br> <br>Vueform is comprehensive form development framework for Vue.js. It supercharges and standardizes the entire form building process and takes care of everything from rendering to validation and processing. With our latest tool, the Drag and Drop Form Builder, you can allow your developers & non-tech workforce to build the most complex forms without coding.
Feature highlights:
- integrate Vueform Drag and Drop Form Builder into any application
- save forms in database as a JSON
- use your own form elements with custom configuration options
- a complete theming and templating system with Tailwind support
- 25+ form elements with multi-file uploads, date pickers and rich text editor
- element nesting and repeating
- 50+ validators with async, dependent and custom rules
- conditional logic on element & form level
- breaking forms into steps with form wizard
- translating form content and global i18n support.
Learn more:
- Builder: https://builder.vueform.com
- Framework: https://vueform.com
Other Vueform libraries:
- @vueform/slider - Vue 3 slider component with multihandles, tooltips merging and formatting.
- @vueform/toggle - Vue 3 toggle component with labels, custom slots and styling options.
Comparison with other libraries
| Feature | @vueform/multiselect | vue-multiselect | vue-select | | --- | :-: | :-: | :-: | | <b>Basic Features*<b> | | Vue.js 2 support | ✓ | ✓ | ✓ | | Vue.js 3 support | ✓ | ~ | ~ | | Single select | ✓ | ✓ | ✓ | | Multiselect (without tags) | ✓ | ✓ | - | | Tags | ✓ | ✓ | ✓ | | Search & filtering | ✓ | ✓ | ✓ | | Option groups | ✓ | ✓ | - | | <b>Advanced features*<b> | | Async search | ✓ | ~ | ~ | | New option when using tags | ✓ | ~ | ✓ | | New option when not using tags | ✓ | - | ✓ | | New option validation | ✓ | ~ | - | | Infinite scroll | ✓ | ~ | ~ | | Append to body | ✓ | ~ | ✓ | | Object value support | ✓ | ✓ | - | | Accents/diacritics sensitivity | ✓ | ~ | ~ | | Search regex | ✓ | - | ~ | | Native select support (required) | ✓ | - | ~ | | <b>Options definition*<b> | | Array | ✓ | ✓ | ✓ | | Object | ✓ | - | - | | Array of objects | ✓ | ✓ | ✓ | | Function (async) | ✓ | - | - | | <b>Styling*<b> | | Override class names | ✓ | - | - | | CSS vars support | ✓ | - | ✓ | | Class based CSS support | ✓ | ✓ | ✓ | | <div><img src="https://upload.wikimedia.org/wikipedia/commons/9/95/Tailwind_CSS_logo.svg" width="160" alt="Tailwind CSS" title="Tailwind CSS" /> support</div> | ✓ | - | - | | <b>Support*<b> | | Accessibility (a11y) | ✓ | ~ | ~ | | Internationalization (i18n) | ✓ | ~ | ~ | | RTL support | ✓ | ✓ | ✓ | | Typescript support | ✓ | ✓ | ✓ | | SSR support | ✓ | ✓ | ✓ | | ES Module support (ESM) | ✓ | - | - | | CSP compilant | ✓ | - | - | | <b>API*<b> | | Events | <b>12</b> | 7 | 11 | | Slots | <b>14</b> | 12 | 11 | | Documented API methods | <b>10</b> | 0 | 0 | | <b>Stats**<b> | | Minzipped size | <b>9.7 KB</b> | 14.2 KB | 20.6 KB | | Open issues | <b>18</b> | 233 | 191 | | Monthly downloads | 180k | <b>1.1M</b> | 947k | | Dependencies | 0 | 0 | 0 | | Coverage | <b>100%</b> | unknown | 96% | | Latest realease | 2022. 12. 21. | 2019. 04. 27. | 2022. 12. 18. |
~ - partial support / requires manual extension or official support is in progress<br>* - as of June 13, 2022 - reviewed periodically<br>** - as of Dec 21, 2022 - reviewed periodically
Disclaimer: based on docs, Github issues and code discovery.
Docs
- Sponsors
- Comparison with other libraries
- Docs
- Demo
- Installation
- Using with Vue 3
- Using with Vue 2
- Support
- Configuration
- API methods
- Events
- Slots
- Styling
- Examples
- Single select
- Multiselect with object options
- Multiselect with disabled options
- Multiselect with groups
- Tags with search, create and array of objects options
- Autocomplete with async options
- Tags with async options
- Select with custom options slot
- Multiselect with custom label slot
- Tags with custom tags slot
- Async options with default values
- Default values that are not among the options using
object: true - Default values that are not among the options using
allowAbsent: true - Manage created tag asynchronously
- Load async options from API on open with infinite scroll
- Multiselect with localized texts
- License
Demo
Check out our <a href="https://jsfiddle.net/xajub20o/" target="_blank">demo</a>.
Installation
npm install @vueform/multiselect
Using with Vue 3
<template>
<div>
<Multiselect
v-model="value"
:options="options"
/>
</div>
</template>
<script>
import Multiselect from '@vueform/multiselect'
export default {
components: {
Multiselect,
},
data() {
return {
value: null,
options: [
'Batman',
'Robin',
'Joker',
]
}
}
}
</script>
<style src="@vueform/multiselect/themes/default.css"></style>
Using with Vue 2
<template>
<div>
<Multiselect
v-model="value"
:options="options"
/>
</div>
</template>
<script>
import Multiselect from '@vueform/multiselect/dist/multiselect.vue2.js'
export default {
components: {
Multiselect,
},
data() {
return {
value: null,
options: [
'Batman',
'Robin',
'Joker',
]
}
}
}
</script>
<style src="@vueform/multiselect/themes/default.css"></style>
Using with < Vue 2.7
Switch to <= 2.4.2 to use the Multiselect with Vue.js < 2.7.
Support
Join our Discord channel or open an issue.
Configuration
Basic props
| Name | {Type} Default | Description |
| --- | --- | --- |
| mode | {string} 'single' | Possible values: 'single'\|'multiple'\|'tags'. |
| options | {array\|object\|function} [] | List of options. Can be:<br>- an array (eg. [1,2,3])<br>- an object (eg. {a:1,b:2,c:3})<br>- an array of objects:<br>[<br> {<br> [valueProp]: 1,<br> [label]: 'v1',<br> disabled:true\|false<br> },<br> //...<br>]<br>- a function returning a Promise (async function) with query and select$ param. The select$ represents the Multiselect component and its API can be accessed. The promise should return options as an object or as an **arra
