Skip to content

Select Component

Select Component

Select is a form component that allows users to choose one or more options from a predefined list of options.

Basic Usage

Basic select for choosing a single option from a dropdown list.

Current value:

Input type

Text type

Show CodeArrow
CopyGitHub

Disabled State

Set the disabled attribute to disable the entire select, or set the disabled attribute of a specific option in options to disable that particular option.

Fully Disabled

Partial Options Disabled

Show CodeArrow
CopyGitHub

Different Sizes

Select supports three sizes: small, default, and large.

Small Size

Default Size

Large Size

Show CodeArrow
CopyGitHub

Clearable

Set the clearable attribute to create a clearable select, allowing users to quickly clear selected items.

Clear count: 0
Current value: 2
Show CodeArrow
CopyGitHub

Multiple Mode

Set the multiple attribute to enable multiple selection mode, allowing users to select multiple options.

Current value: []

Filterable Multiple

Custom View

Show CodeArrow
CopyGitHub

Set the filterable attribute to enable filtering functionality, supporting local filtering, or implement remote search through remote-method.

Local Filtering

Custom Filter Method

Remote Search

Results will show after 1 second of typing
Show CodeArrow
CopyGitHub

Custom Options

Select supports customizing option content and prefix icons through slots.

Custom Prefix Icon

Custom Option Content

Custom Empty State

Show CodeArrow
CopyGitHub

Cascade Selection

Select supports cascade selection functionality, configure multi-level data through the children attribute.

Basic Cascade Selection

Current value:

Path Display Mode

Show Full Path

Show Last Level Only

Selection Mode Control

Strict Mode

Free Mode

Show CodeArrow
CopyGitHub

Select API

Attributes

AttributeDescriptionTypeAccepted ValuesDefault
v-modelBinding valuestring / number / object / array
v-model:loadingLoading statebooleanfalse
optionsOption dataarray[]
typeSelect typestringinput / textinput
sizeSizestringsmall / default / largedefault
clearableWhether clearablebooleantrue
disabledWhether disabledbooleanfalse
empty-textText displayed when no datastringNo data
filterableWhether filterablebooleanfalse
multipleWhether multiple selectionbooleanfalse
placeholderPlaceholder textstringPlease select
show-all-levelsWhether to show complete cascade pathbooleantrue
check-strictlyWhether to strictly select leaf nodesbooleantrue
select-parentWhether parent can be selectedbooleanfalse
remote-methodRemote search methodfunction(query)
filter-methodCustom filter methodfunction(option, query)

Option Configuration

ParameterDescriptionTypeAccepted ValuesDefault
valueOption valuestring / number / object
labelOption labelstring
disabledWhether to disable this optionbooleanfalse
childrenChild option list for cascade selectionarray
subLabelOption sub-labelstring

Events

Event NameDescriptionParameters
changeTriggered when option changes(option: OptionsItemType)
clearTriggered when clear button is clicked
visible-changeTriggered when dropdown visibility changes(visible: boolean)
focusTriggered when gaining focus(event: FocusEvent)
blurTriggered when losing focus(event: FocusEvent)
remove-tagTriggered when removing tag in multiple mode(value: SingleValueType)
inputTriggered when input value changes in filterable mode(value: string)
cascade-changeTriggered when cascade menu switches(path: OptionsItemType[])

Methods

Method NameDescriptionParameters
focusFocus select
blurBlur select
clearClear selection

Slots

Slot NameDescriptionScope Parameters
defaultCustom option content{ row: OptionsItemType, index: number }
prefixSelect header content
multiple-viewCustom view in multiple mode{ model: ValueType }
emptyCustom empty state content

Style Variables

The select component uses the following style variables, which can be customized through SCSS variables:

Variable NameDescription
$theme-color-primaryTheme color - Primary
$border-color-defaultDefault border color
$text-color-defaultDefault text color
$bg-color-defaultDefault background color
$bg-color-hoverHover background color
$opacity-disabledDisabled state opacity
$font-size-smallSmall font size
$font-size-defaultDefault font size
$font-size-largeLarge font size
$color-whiteWhite color
$z-index-upUpper layer z-index

Released under the MIT License