vael-ui v0.3.10

Selection

Combobox

A searchable dropdown that also accepts free text, so autocomplete and tagging are one component.

Install

import { Combobox } from 'vael-ui'

Playground

import { Combobox } from 'vael-ui'

<Combobox placeholder="" :multiple="false" :maxLabels="0" :disabled="false" :invalid="false" size="md" :loading="false" :clearable="false" virtualize name="" :allowCustom="false" openOnFocus side="bottom" align="start" :sideOffset="8" :alignOffset="0" closeOnEsc closeOnOutside :forceMount="false" scrollFade motionCss query="" :items="items">Combobox</Combobox>

Props

NameTypeDefaultDescription
itemsreadonly T[]
placeholderstring | undefined
multipleboolean | undefinedfalseModel becomes `(string | number)[]`. Selecting adds an item without closing the panel; clicking a selected row removes it. Selections render as removable chips.
maxLabelsnumber | undefined`multiple` only: how many selected items render as chips before collapsing the rest into a "+N" indicator. Default: uncollapsed.
disabledboolean | undefinedfalse
invalidboolean | undefinedfalse
size"md" | "sm" | "lg""md"
loadingboolean | undefinedfalse
clearableboolean | undefinedfalse
virtualizeboolean | SelectVirtualizeConfig | undefinedundefined`true`/`false` forces virtualization on/off; an object also tunes `itemSize`/`overscan`. Default: auto-virtualizes past 100 items.
namestring | undefined
filterComboboxFilter<T> | undefinedtrue`true` (default): case/diacritic-insensitive local match on `getLabel`. `false`: consumer filters (bind `items` to an async result) — `filteredItems` becomes `items` verbatim. A function: fully custom local match.
allowCustomboolean | undefinedfalseEnter with no active option, or blur with unmatched text, commits the raw typed string as the model value and emits `create`.
openOnFocusboolean | undefinedundefinedOpens the panel on focus before typing (the discoverability default). Set `false` to require typing first.
side"top" | "right" | "bottom" | "left""bottom"
align"start" | "end" | "center""start"
sideOffsetnumber | undefined8
alignOffsetnumber | undefined0
closeOnEscboolean | undefinedtrue
closeOnOutsideboolean | undefinedtrue
beforeClose((done: () => void) => void) | undefinedDefers closing (animation gate pattern): called when close is requested, call `done()` to proceed.
forceMountboolean | undefinedfalse
teleportTostring | HTMLElement | undefined"body"
scrollFadeboolean | undefinedtrue
maxPanelHeightnumber | undefinedCaps the panel's height at this many pixels even when the viewport has room for more — the option list scrolls internally past it instead of the panel growing indefinitely. Omitted keeps today's behavior (only the viewport limits it).
motionCssboolean | undefinedtrueGates the built-in chip enter/exit/reposition transition (`multiple` only). `false` skips it entirely — reach for `@chip-enter`/`@chip-leave` instead if you want a consumer-owned animation (GSAP, motion-v) in its place.
uiPartial<{ root: UiPartValue; input: UiPartValue; positioner: UiPartValue; panel: UiPartValue; header: UiPartValue; list: UiPartValue; option: UiPartValue; empty: UiPartValue; footer: UiPartValue; }> | undefined
modelValuestring | number | (string | number)[] | null | undefinednull
querystring | undefined""
openboolean | undefinedfalse

Slots

NameTypeDescription
startany
endanyRenders before the library's own clear/chevron, inside Input's `#end`.
header{ count: number; total: number; }Above the listbox, inside the popover panel.
item{ item: T; active: boolean; selected: boolean; }
emptyany
footeranyBelow the listbox, inside the popover panel.

Events

NameTypeDescription
open-change[value: boolean, details: PopoverOpenChangeDetails]
select[item: T]
change[value: string | number | (string | number)[] | null]
reach-end[]
chip-enter[el: Element, done: () => void]
chip-leave[el: Element, done: () => void]
create[query: string]
update:open[value: boolean]
update:modelValue[value: string | number | (string | number)[] | null]
update:query[value: string]

Exposed

NameTypeDescription
elunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.
inputElunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.
panelElunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.
positionerElunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.
listElunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.
placementunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.
positionerStyleunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.
isClosingunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.
openunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.
closeunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.
cancelCloseunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.
activeIndexunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.
scrollToIndexunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.