SearchSelect
Searchable select input with local filtering, remote search events, and Popover-backed options panel.
SearchSelect
TxSearchSelect combines a text input, local option filtering, optional remote search, and a Popover-backed options panel. Disabled options stay visible but cannot be selected.
The dropdown layer is hosted by TxPopover with full-width reference anchoring and no reference-click toggle.
Basic Usage
SearchSelect
Demo will load when visible.
Remote Search
When remote=true, input changes (debounced) and Enter trigger the search event; fetch externally and write results back to options.
SearchSelect (remote)
Demo will load when visible.
Notes
- Local mode filters by
options.labeland shows all when input is empty. - Remote mode requires updating
optionsin thesearchevent; results are not cached. - Closing the dropdown keeps input and panel state; reopening does not auto-reset.
API
Props
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | string | number | '' | Selected option value controlled by v-model. |
placeholder | string | 'Search' | Placeholder forwarded to the search input. |
disabled | boolean | false | Disables the input, popover, focus open, and remote search emission. |
clearable | boolean | true | Shows the input clear affordance and allows clearing the selected value. |
options | TxSearchSelectOption[] | [] | Option records displayed in the dropdown; disabled options cannot be picked. |
loading | boolean | false | Shows a small spinner in the input suffix while results are loading. |
remote | boolean | false | Disables local filtering and emits search so the caller can provide external results. |
searchDebounce | number | 200 | Debounce delay in milliseconds before emitting remote search after input changes. |
dropdownMaxHeight | number | 280 | Maximum options panel height in pixels. |
dropdownOffset | number | 6 | Popover offset from the input reference. |
panelVariant | 'solid' | 'dashed' | 'plain' | 'solid' | Popover panel surface variant. |
panelBackground | 'pure' | 'mask' | 'blur' | 'glass' | 'refraction' | 'refraction' | Card background style |
panelShadow | 'none' | 'soft' | 'medium' | 'soft' | Popover panel shadow strength. |
panelRadius | number | 18 | Popover panel corner radius. |
panelPadding | number | 6 | Popover panel inner padding. |
Events
| Event | Params | Description |
|---|---|---|
update:modelValue | (v: string | number) | v-model update emitted after selecting an enabled option or clearing. |
change | (v: string | number) | Emitted with the same value after selection or clear. |
search | (q: string) | Emitted in remote mode after debounce, and immediately on Enter. |
select | (opt: TxSearchSelectOption) | Emitted with the picked enabled option before the dropdown closes. |
open | - | Emitted when the options panel opens. |
close | - | Emitted when the options panel closes; pending remote-search debounce is cleared. |
Types
export interface TxSearchSelectOption {
value: string | number
label: string
disabled?: boolean
}