Select API

This page provides an overview of the Select component API, detailing its props, emits, slots, and exposed methods/states.

Props

The Select component accepts the following props:

PropDefaultTypeDescription
dataSelect[]Array<BaseDataItem>The data items available for selection.
autoFocusfalsebooleanAutomatically focuses the select input on mount.
keySelect"id"string or "id"The key used to uniquely identify each item in the data set.
valueSelect"value"string or "value"The key used to retrieve the display value of each item.
multiplefalsebooleanEnables multiple item selection.
maxVisibleundefinednumberThe maximum number of items visible in the dropdown list.
closeButtonBadgefalseBadgeProps["closeButton"]Enables a close button for badges in multiple selection mode.
noData"No data available"stringText displayed when there are no items in the list.
noQueryfalsebooleanDisables the query-based filtering of items.
classSelect"justify-end"StyleClass or "justify-end"Custom CSS class for the select container.
classSelectList""StyleClassCustom CSS class for the dropdown list container.
classMaskQuery"font-bold text-theme-700 dark:text-theme-300"stringCustom CSS class for the query text mask.
paramsFixWindow{}Omit<FixWindowProps, "modelValue">Configuration for the dropdown's positioning behavior.
idundefinedstringUnique identifier for the select component.
modelValueundefinednumber or string or NonNullable<unknown> or null or Array<number or string or null>The current value of the select field.

Emits

The Select component emits the following events:

EmitPayloadDescription
update:isInvalidSelectProps["isInvalid"]Emitted when the invalid state is updated.
update:modelValueSelectProps["modelValue"] or null, Array<any> or undefinedEmitted when the selected value is updated.
change:modelValueSelectProps["modelValue"] or null, Array<any> or undefinedEmitted when the selected value changes.
isActivebooleanEmitted when the select component becomes active or inactive.

Slots

The Select component provides the following slots:

SlotPayloadDescription
defaultVNode[]Default slot for custom content inside the select component.
valuesVNode[]Slot for custom content for the selected values.
itemVNode[]Slot for custom content for each item in the dropdown list.
beforeVNode[]Slot for content to be displayed before the select field.
afterVNode[]Slot for content to be displayed after the select field.

Expose

The Select component exposes the following methods and states via ref:

ExposeValueDescription
layoutInputLayoutExpose or undefinedReference to the input layout component.
selectListWindowFixWindowExpose or undefinedReference to the dropdown list's window.
selectBodyHTMLElement or undefinedReference to the select container element.
selectListHTMLElement or undefinedReference to the dropdown list container element.
selectSearchHTMLElement or undefinedReference to the search input element within the dropdown.
selectItemsHTMLElement or undefinedReference to the list of selectable items.
activeItemnumberThe index of the currently active item.
querystringThe current query string used for filtering items.
isOpenListbooleanIndicates whether the dropdown list is open.
classLayoutSelectProps["class"]Custom CSS class for the layout.
valueSelectProps["modelValue"]The current value of the select field.
visibleValueArray<any>The visible value(s) of the select component.
valueKeysArray<any>The keys of the selected values.
keySelectSelectProps["keySelect"] or nullThe key used to uniquely identify items.
valueSelectSelectProps["valueSelect"] or nullThe key used to retrieve item display values.
dataSelectSelectProps["dataSelect"]The list of available items.
autoFocusNonNullable<SelectProps["autoFocus"]>Indicates whether autofocus is enabled.
modeNonNullable<SelectProps["mode"]>Indicates the current styling mode.
isDisabledNonNullable<SelectProps["disabled"]>Indicates whether the select is disabled.
isLoadingNonNullable<SelectProps["loading"]>Indicates whether the select is in a loading state.
isInvalidNonNullable<SelectProps["isInvalid"]>Indicates whether the select is invalid.
messageInvalidSelectProps["messageInvalid"]The validation message for the select component.
isValuebooleanIndicates whether the select has a value.
isMultipleNonNullable<SelectProps["multiple"]>Indicates whether multiple selection is enabled.
maxVisibleSelectProps["maxVisible"] or undefinedThe maximum number of items visible in the dropdown list.
noDataNonNullable<SelectProps["noData"]>The text displayed when no items are available.
isQueryNonNullable<SelectProps["noQuery"]>Indicates whether query-based filtering is disabled.
classMaskQueryNonNullable<SelectProps["classMaskQuery"]>Custom CSS class for the query text mask.
dataListArray<any>The processed list of data items for rendering.
paramsFixWindowNonNullable<SelectProps["paramsFixWindow"]>Configuration for the dropdown's positioning behavior.
classBaseSelectProps["classSelect"]Custom CSS class for the select base container.
classSelectListSelectProps["classSelectList"]Custom CSS class for the dropdown list container.

Methods:

  • focusSelect(isFocus: boolean): void - Sets the focus state of the select component.
  • openSelect(): void - Opens the dropdown list.
  • closeSelect(event: MouseEvent): void - Closes the dropdown list.
  • select(selectValue: BaseDataItem or null): void - Selects a specific item or clears the selection.
© 2025 FishtVue by Egoka