Skip to content

API Reference

Props

The VSelect component accepts the following props:

PropTypeDefaultDescription
modelValueany | any[]nullThe value of the selected option(s). Supports v-model.
optionsSelectOption[][]Array of options to display. Supports nested groups via children.
labelstringundefinedLabel text displayed above the select input.
placeholderstring'Select...'Placeholder text when no option is selected.
multiplebooleanfalseEnables multi-selection mode. Values are displayed as tags.
searchablebooleanfalseEnables search/filter functionality.
disabledbooleanfalseDisables the entire component.
idstringautoUnique ID for the component (ARIA).
errorstringundefinedError message to display below the input (adds has-error class).
onCreate(payload: { parent: any, value: string }) => voidundefinedCallback for "Creator Mode" when adding new items.

Option Interface

typescript
interface SelectOption {
    label: string
    value: string | number
    disabled?: boolean
    children?: SelectOption[] // For nested groups
}

Events

EventPayloadDescription
update:modelValueanyEmitted when selection changes.
create{ parent, value }Emitted when a new item is created (Creator Mode).

Slots

SlotScopeDescription
option{ option }Custom content for each option in the dropdown.
value{ value, label }Custom content for the selected value (single mode).
empty-Content displayed when no options match filter.
trigger-icon{ isOpen }Icon displayed in the trigger (arrow/chevron).
group{ group }Header content for option groups.
creator{ cancel }Custom input area for Creator Mode.
toggle-icon{ collapsed, option }Icon for expanding/collapsing groups.
add-icon{ option }Icon for adding children (Creator Mode).

CSS Variables

You can customize the appearance by overriding these CSS Custom Properties:

css
:root {
  --vs-primary: #3b82f6;
  --vs-danger: #ef4444;
  --vs-border: #d1d5db;
  --vs-bg: #ffffff;
}