Skip to main content

We have released KoliBri - Public UI v4 (Next). For the LTS version, see .

Your opinion matters! Together with you, we want to continuously improve KoliBri. Share your ideas, wishes, or suggestions—quickly and easily.

Combobox

Synonyms: Autocomplete, Select, Dropdown

The Combobox component creates a selection list that combines an input field with a list of selectable options displayed below.

Construction

Code

<kol-combobox _suggestions="['Herr','Frau','Firma']" _label="Anrede" _value="Herr"></kol-combobox>

Events

For the handling of events or callbacks, see .

EventtriggerValue
clickInput field is clicked-
focusInput field is focused-
blurInput field loses focus-
inputValue is changed by enteringCurrent value of the input field
changeEntry has been completedCurrent value of the input field

Example

Usage

The choices are passed to the component as a JSON array via the _suggestions attribute.

Example of constructing the JSON array:

["Herr", "Frau", "Firma"]

Keyboard controls

buttonFunction
TabFocuses the selection field.
EnterIf the listbox is open and an option is focused, this function selects the focused option and closes the listbox. If no option is focused, it just opens the listbox.
ArrowDownOpens the listbox when it is closed and moves the visual focus down one option when the listbox is open.
ArrowUpOpens the listbox when it is closed and moves the visual focus up one option when the listbox is open.
Escape (Esc)Closes the listbox and removes visual focus from the combobox without making a selection.
HomeMoves visual focus to the first option in the listbox.
EndMoves the visual focus to the last option in the listbox.
PageUp(PageUp)Jumps ten options up in the list box and focuses on the corresponding option.
PageDown(PageDown)Jumps ten options down in the list box and focuses on the corresponding option.
Printable CharactersFocuses on the first option that begins with the pressed character.

Properties

PropertyAttributeDescriptionTypeDefault
_accessKey_access-keyDefines the key combination that can be used to trigger or focus the component's interactive element.string | undefinedundefined
_disabled_disabledMakes the element not focusable and ignore all events.boolean | undefinedfalse
_hasClearButton_has-clear-buttonShows the clear button if enabled.boolean | undefinedtrue
_hideLabel_hide-labelHides the caption by default and displays the caption text with a tooltip when the interactive element is focused or the mouse is over it.boolean | undefinedfalse
_hideMsg_hide-msgHides the error message but leaves it in the DOM for the input's aria-describedby.boolean | undefinedfalse
_hint_hintDefines the hint text.string | undefined''
_icons_iconsDefines the icon classnames (e.g. _icons="fa-solid fa-user").string | undefined | { right?: IconOrIconClass | undefined; left?: IconOrIconClass | undefined; }undefined
_id_id[DEPRECATED] Will be removed in the next major version.

Defines the internal ID of the primary component element.
string | undefinedundefined
_label (required)_labelDefines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.). Set to false to enable the expert slot.stringundefined
_msg_msgDefines the properties for a message rendered as Alert component.Omit<AlertProps, "_on" | "_hasCloser" | "_label" | "_level" | "_variant"> & { _description: string; } | string | undefinedundefined
_name_nameDefines the technical name of an input field.string | undefinedundefined
_on--Gibt die EventCallback-Funktionen für das Input-Event an.InputTypeOnBlur & InputTypeOnClick & InputTypeOnChange & InputTypeOnFocus & InputTypeOnInput & InputTypeOnKeyDown | undefinedundefined
_placeholder_placeholderDefines the placeholder for input field. To be shown when there's no value.string | undefinedundefined
_required_requiredMakes the input element required.boolean | undefinedfalse
_shortKey_short-keyAdds a visual shortcut hint after the label and instructs the screen reader to read the shortcut aloud.string | undefinedundefined
_suggestions (required)_suggestionsSuggestions to provide for the input.W3CInputValue[] | stringundefined
_tooltipAlign_tooltip-alignDefines where to show the Tooltip preferably: top, right, bottom or left."bottom" | "left" | "right" | "top" | undefined'top'
_touched_touchedShows if the input was touched by a user.boolean | undefinedfalse
_value_valueDefines the value of the element.string | undefinedundefined

Methods

getValue

getValue() => Promise<string>

Returns the current value.

Returns

Type: Promise<string>

kolFocus() => Promise<void>

Sets focus on the internal element.

Returns

Type: Promise<void>

Slots

SlotDescription
Die Beschriftung des Eingabefeldes.

View example