MazSelect - with "multiple" options
MazSelect is a standalone component that replaces the standard html input select with a beautiful design system. There are many options like multiple values, search text field, custom templates options, colors, sizes, disabled, loading, error, warning, valid states, error messages, and icons.
INFO
Before you have to import the global css files in your project, follow instructions in Getting Started
TIP
This component use MazInput, so it inherits all his props
Basic usage
selectedValue:
Multiple
selectedValues:
Search
Use search
property to add a search input in the options list
TIP
You can use your own template to replace the empty icon when no results are found
View code
<MazSelect>
<template #no-results>
<div class="p-4 text-center">
No result
</div>
</template>
</MazSelect>
INFO
You can adjust the search results by using search-threshold
where 1 is a perfect match and 0 is a match with any character
<MazSelect :search-threshold="0.75" :options="[...]" />
Custom search function
You can provide your own search function to customize the search behavior
Opt Group
Group your options like a native optgroup
Custom template options
Customize the options list with your own template
Custom options model
By default, the options should be an array of { value: any, label: string }
If you want custom keys of these options, you can use:
option-value-key
to override the key of the value in your optionoption-label-key
to override the key of the label to show in the option listoption-input-value-key
to override the key of the value to show in the input
Example
Types
type ModelValueSimple = string | number | null | undefined | boolean