Select component

Updated at:

Introduction

The select component is a user interface (UI) element that displays a list of options, allowing you to select a single item. This component is commonly used in forms and filter settings.

image

Configurations

Category

Configuration

Example

Description

Content

Option list

Configure the options manually or through mapping. To configure manually, set each currentItem directly. To use mapping, configure a data source array. Each currentItem must have label and value properties.

Default value

The default selected option.

Placeholder content

The placeholder content.

Label

The form label. For more information, see Common form properties.

Interaction

Hidden

Hides the component. For more information, see Common properties.

Search

Displays the search icon.

Loading

Displays the loading animation.

Disabled

Disables the component.

Validation

Form validation. For more information, see Common form properties.

Style

Margin

The margin of the component. For more information, see Common properties.

Clear button

Shows or hides the clear button.

Variants

Provides different style variants. The available CSS styles may differ for each variant.

Empty state text

The text to display when the option list is empty.

CSS Styles

Border radius

The border radius.

Option font size

The font size of the dropdown options.

Subject font size

The main font size of the component.

Label font size

The font size of the label.

Properties and methods

Name

Type

Example

Description

value

string

select.value

The selected value of the component.

labelText

string

select.labelText

The text content of the component's label.

selectedLabel

string

select.selectedLabel

The label of the selected option.

disabled

boolean

select.disabled

Specifies whether the component is disabled.

loading

boolean

select.loading

Specifies whether the component is in a loading state.

data

array

select.data

The option list of the component.

hidden

boolean

select.hidden

Specifies whether the component is hidden.

validationStatus

boolean

select.validationStatus

The validation status of the component.

validationMessage

string

select.validationMessage

The validation message of the component.

blur

func

select.blur()

Removes focus from the component.

focus

func

select.focus()

The component receives focus.

validate

func

select.validate()

Component Validation

setValue

func

select.setValue('')

Set the component content

setDisabled

func

select.setDisabled(true)

Sets whether the component is disabled.

setHidden

func

select.setHidden(true)

Sets the hidden state of the component.

clearValue

func

select.clearValue()

Clears the value of the component.

clearHidden

func

select.clearHidden()

Clears the hidden value of the component.

clearValidate

func

select.clearValidate()

Clears the validation information of the component.

Event callbacks

Configuration

Description

An event that is triggered when the component's value changes.