Skip to content

Select

Selects are form controls to select an option, or options, from a set of options. When a user taps the select, a dialog appears with all of the options in a large, easy to select list.

Examples

Basic Usage

js
<Mdx-select v-model="select" :options="options" label="Select" />

Multiple selection

By adding the multiselect prop to select, users are able to select multiple options.

js
<Mdx-select v-model="select" multiselect="true" :options="options" label="Multiselect" />

Searchable

You can enable search by passing prop searchable. If you want to add highlight to matched part of the option pass prop highlighted as well

js
<Mdx-select v-model="select" searchable="true" :options="options" label="Searchable" />

<br />

<Mdx-select v-model="select" searchable="true" highlighted="true" :options="options" label="Searchable with highlights" />

Validations

You can add validations by using Vuelidate value for v-model. Validations will be automatically parsed from v$

js
<Mdx-select v-model="v$.select" :options="options" label="Select" />

Properties

v-model

DescriptionYou can pass simple variable to v-model as well as Vueliade v$.variable to enabling validations
Type"Object" | "String" | "null"
Requiredtrue

label

DescriptionThe visible label associated with the select.
TypeString
Requiredtrue

options

DescriptionArray of options for the select. If null is passed, loading animation will be shown
Type"Array" | "null"
Defaultnull

multiselect

DescriptionEnables checkboxes for multiselect functionality
TypeBoolean
Defaultfalse

searchable

DescriptionEnables text input for search functionality
TypeBoolean
Defaultfalse

highlighted

DescriptionHighlights matched part of the option. searchable must be set to true
TypeBoolean
Defaultfalse

optionKey

DescriptionDefines which property from options will be used as key
TypeString
Defaultkey

optionDisabledKey

DescriptionDefines which property from options will be disabled
TypeString
Defaultdisabled

optionTagKey

DescriptionDefines which property from options will be tagged
TypeString
Defaulttag

optionValue

DescriptionDefines which property from options will be used as value
TypeString
Defaultvalue

optionsMaxHeight

DescriptionDefines the maximum height of options dropdown
TypeString
Default440px

optionsWidth

DescriptionDefines the width of options dropdown
TypeString
Default100%

optionsCompact

DescriptionLowers the line-height of the options
TypeBoolean
Defaultfalse

disabled

DescriptionIf true, the user cannot interact with the select.
TypeBoolean
Defaultfalse

debounce

DescriptionSet the amount of time, in milliseconds, to wait to load options after each keystroke.
Type"Number"
Default300

size

DescriptionThe height of the select.
Type"small" | "default"
Defaultdefault