Skip to content

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

Select color


selectedValue:

Multiple

Choose options


selectedValues:

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
html
<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

html
<MazSelect :search-threshold="0.75" :options="[...]" />
Select color

Custom search function

You can provide your own search function to customize the search behavior

Opt Group

Group your options like a native optgroup

Select options

Custom template options

Customize the options list with your own template

Select color

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 option
  • option-label-key to override the key of the label to show in the option list
  • option-input-value-key to override the key of the value to show in the input

Example


Types

ts
type ModelValueSimple = string | number | null | undefined | boolean