Search documentation

Find a component or a docs page

Combobox

Autocomplete input with a list of suggestions.

Usage

Basic

ComboboxInput is the trigger: typing filters the list, the arrow keys move through it and Enter picks. Each item carries a native radio named after the root's name:, so the form submits the selection.

With clear button

show_clear: adds a button that clears the value; it shows while there is one.

With groups

ComboboxGroup and ComboboxLabel name a set of items; ComboboxSeparator divides them. Groups with no match hide while searching.

Disabled items

Disabled

Invalid

Side

side: (top, right, bottom, left) and align: (start, center, end) place the popup; side_offset: and align_offset: set the gap.

Multiple

multiple: true picks several items, shown as chips. Backspace on the empty input removes the last one.

Select all

RubyUI extras: ComboboxToggleAll is an option that selects every enabled item, or clears them when all are selected; it hides while searching and also works in a popup (next example). ComboboxChips(max: 3) keeps the box small: past three items the chips collapse into one "5 frameworks" chip (term: from the root), whose remove button, like Backspace, clears the selection.

Form

required: makes the browser validate the selection: one radio for a single combobox, at least one checkbox for multiple: true. FormField shows the message and marks the visible input invalid.

Installation

Components

ComponentBuilt usingSource
ComboboxPhlex
ComboboxChipPhlex
ComboboxChipsPhlex
ComboboxChipsInputPhlex
ComboboxContentPhlex
ComboboxContextPhlex
ComboboxDocsPhlex
ComboboxEmptyPhlex
ComboboxGroupPhlex
ComboboxInputPhlex
ComboboxItemPhlex
ComboboxLabelPhlex
ComboboxListPhlex
ComboboxSeparatorPhlex
ComboboxToggleAllPhlex
ComboboxTriggerPhlex
ComboboxValuePhlex
ComboboxControllerStimulus JS