Skip to content

Combobox ​

Searchable select

A text field that searches a list as you type — the right control when a BlessSelect would have more options than a person can scan. multiple turns picks into removable chips; creatable lets the user add an option that isn't there yet and emits create so you can persist it.

For a handful of options use BlessSelect (native, no JS). For commands rather than values, use BlessCommand.

Filtering is client-side over options. For server-side search, listen to search (the query as typed) and bind options to what comes back — the list re-renders, nothing else changes. Keyboard: ↑ / ↓ move, Enter picks (or creates), Esc closes, and in multiple mode Backspace on an empty query removes the last chip. Inside a BlessField the field's label names the input; label is for a combobox with no visible label.

Basic
加藤恵
澤村・スペンサー・英梨々
霞ヶ丘詩羽
氷堂美智留
波島出海
安芸倫也
value:
加藤恵 澤村・スペンサー・英梨々
加藤恵
澤村・スペンサー・英梨々
霞ヶ丘詩羽
氷堂美智留
波島出海
安芸倫也
values: [ "megumi", "eriri" ]
加藤恵
加藤恵
澤村・スペンサー・英梨々
霞ヶ丘詩羽
氷堂美智留
波島出海
安芸倫也

Not inside <p>

The floating panel is a <div>. HTML closes a <p> when it meets a <div>, so a trigger placed inside a paragraph renders differently on the server and the client. Wrap with <span>/<div> instead.

Usage ​

ts
import { BlessCombobox } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
idstring—
options*BlessOption<T>[]—
placeholderstring—
multipleboolean—
creatableboolean—allow creating a new option from the query; emits `create`
disabledboolean—
invalidboolean—
emptyTextstring"No results."
size"md" | "sm" | "lg""md"
labelstring—accessible name when there is no <label for>
modelValueT | T[]—

Events

NamePayloadDescription
search[query: string]
create[label: string]
update:modelValue[value: T | T[] | undefined]

Slots

NameScopeDescription
option{ option: BlessOption<T>; }

Released under the MIT License. Character names and artwork belong to their owners.