Multi-Select
The existing Select component supports multi-selection via the multiple prop. The value is an array of selected option values.
Basic usage
Selected: none
vue
<script setup>
import { ref } from 'vue'
const selected = ref([])
</script>
<template>
<Select
v-model="selected"
:multiple="true"
:options="['Crusher Run', 'Screenings', 'Gabion Stone', 'Rip Rap', 'Dust']"
/>
</template>Pre-selected values
Selected: blue
vue
<!-- pre-selects 'blue' -->
<Select
v-model="colors"
:multiple="true"
:options="[
{ label: 'Red', value: 'red' },
{ label: 'Blue', value: 'blue' },
{ label: 'Green', value: 'green' },
]"
/>Disabled
vue
<Select
:model-value="['Screenings', 'Gabion Stone']"
:multiple="true"
:options="['Crusher Run', 'Screenings', 'Gabion Stone', 'Rip Rap']"
disabled
/>Props
When multiple is true, the following props change behaviour:
| Prop | Type (multiple mode) | Description |
|---|---|---|
modelValue | (string | number)[] | Array of selected values |
multiple | boolean | Enables multi-selection |
placeholder | — | Ignored in multiple mode (no placeholder option) |
All other Select props (options, disabled, error, hint) work the same.
Tips
- Hold
Ctrl/Cmdto toggle individual options. - Hold
Shiftto select a range. - The
modelValuewill always be an array whenmultipleistrue.