Skip to content
Theme:

Ui3nSelector ​

Selector component for choosing items from a dropdown list with search and customization options.

Props

NameTypeDefaultDescription
idstring | undefined —

Root element id

namestring | undefined —

HTML name attribute for form submission

modelValue*Ui3nSelectorValue<T> —

Current selector value

labelstring | undefined""

Label text

placeholderstring | undefined —

Placeholder text

itemsT[] | undefined[] as T[]

Items to display

itemValuekeyof T | undefined"id"

Property to use as value

itemDisplaykeyof T | Ui3nSelectorItemDisplayingFunction<T> | undefined —

Property or function to display item

returnObjectboolean | undefinedfalse

Whether to return the whole object or just the value

clearableboolean | undefinedfalse

Whether to show clear button

hideSelectedboolean | undefined —

Whether to hide selected item

noDataTextstring | undefined""

Text to show when no data

disabledboolean | undefined —

Whether selector is disabled

Slots

Slot NameScope Props (v-slot)Description
#noDataText —

No data text slot

#item{ item: T; index: number; activeIndex: Nullable<number>; }

Item slot

#selection{ value: Ui3nSelectorValue<T>; selectedItem: T | undefined; }

Selection slot

CSS Variables

Set any of these where you need it — on :root, on a container, or on the element itself through [data-ui3n] — and the component follows. Leave them alone and it uses the defaults below.

NameDefault
--ui3n-selector-activator-height32px
--ui3n-selector-body-border-radius8px
--ui3n-selector-body-padding4px
--ui3n-selector-border-radiuscalc(var(--_selector-activator-height) / 2.5)
--ui3n-selector-font-size12px
--ui3n-selector-item-border-radius4px
--ui3n-selector-item-font-size13px
--ui3n-selector-item-min-height32px
--ui3n-selector-item-padding4px
--ui3n-selector-trigger-font-size13px
--ui3n-selector-trigger-padding0 24px 0 8px

Usage Examples ​

Country Selection (Flat Value Mode) ​

Demonstrates the standard single dropdown selection where the component tracks and returns a primitive identifier (id) string.

Country Selection

Standard selector with flat string items and primitive model tracking

Fruit Selection (Clearable Mode) ​

Demonstrates a dropdown list with fruit options where the component returns the complete entity object and provides an integrated close button to quickly reset the selected value.

Fruit Selection

Clearable selector returning the full data object with an integrated quick-reset button

Custom Layout (Item & Selection Slots) ​

Demonstrates utilizing template slots to override both the dropdown menu rows and the field trigger displaying view with customized avatar elements.

Custom Item & Selection Layout

Selector component overriding default rows and placeholder text with complex markup slots