Combobox — Playground

px
mode
State
html.html
<kui-field label="Assignee">
  <input kuiCombobox [(value)]="assignee" [(query)]="query" [kuiLabelFn]="personLabel" placeholder="Search people..." [clearable]="true" />
  <kui-dropdown>
    @for (person of filteredPeople(); track person.id) {
      <button kuiOption [value]="person">{{ person.name }}</button>
    }
  </kui-dropdown>
</kui-field>
NameTypeDefaultDescription
valueT | string | nullnullSelected value. Bound by [formField] or [(value)].
querystring''Current search text shown in the native input.
searchoutput: string-Emitted on every native input edit. Use for local filtering or remote requests.
kuiLabelFn(item: T) => stringString()Maps a selected object value to display text. Required when T is not a primitive.
placeholderstring''Native input placeholder shown when no value is selected.
mode'filter' | 'free' | 'async''filter'filter clears the value while editing until a kuiOption is selected. free stores typed text as the value. async documents that filtering happens outside the directive.
clearableboolean | undefinedtrueShows a clear affordance. Falls back to KUI_COMBOBOX_OPTIONS, then KUI_FIELD_OPTIONS, then true.
loadingbooleanfalseShows a suffix loader. Loading row content inside kui-dropdown is projected by the consumer.
disabledbooleanfalseDisables the native input. Set by [formField] or directly.
readonlybooleanfalseKeeps the value readable but prevents editing and opening the dropdown.
invalidbooleanfalseApplies ARIA invalid state. kui-field also contributes invalid state from validation.
errorsreadonly ValidationError[][]Validation errors set by [formField], consumed by kui-field for automatic error text.
touchedbooleanfalseTouched state set by [formField] or Signal Forms.
touchoutput: void-Emitted when an opened dropdown closes; marks the control touched for Signal Forms.
idstring | undefinedundefinedExplicit id override. Inside kui-field, the field id is used when omitted.
kuiOptiondirective-Marks a projected option inside kui-dropdown. Provides role="option", aria-selected, disabled state, and keyboard navigation.
kuiComboboxHighlightpipe: (label: string, query: string | null | undefined) => readonly { text: string; match: boolean }[]-Splits an option label into plain and matched segments for highlighting the current query.
kuiProvideComboboxOptions(opts: KuiComboboxOptions) => Provider-Registers app-wide combobox defaults, such as clearable, via KUI_COMBOBOX_OPTIONS.
KUI_COMBOBOX_OPTIONSInjectionToken<KuiComboboxOptions>-Injection token backing kuiProvideComboboxOptions. Read by the directive for clearable fallback.
--kui-combobox-affordance-sizeCSS custom property-Size of the suffix clear/chevron affordance controls.
--kui-combobox-suffix-gapCSS custom property-Gap between suffix affordances (clear button, chevron, loader).
--kui-combobox-loader-sizeCSS custom property-Diameter of the suffix loading spinner.
--kui-combobox-loader-border-widthCSS custom property-Border width of the suffix loading spinner.
--kui-combobox-loader-durationCSS custom property-Animation duration of the suffix loading spinner.
--kui-combobox-highlight-bgCSS custom property-Background color of matched text inside kui-combobox-highlight.
--kui-combobox-highlight-textCSS custom property-Text color of matched text inside kui-combobox-highlight.
--kui-combobox-highlight-radiusCSS custom property-Corner radius of the matched-text highlight mark.

Inputs and outputs verified against @kikita-labs/ui v1.6.1 public typings.