Skip to content

Forms

ICombobox

A select you can type into. It takes the same items as ISelect and filters them against the query. The field shows the selected option's label; the model holds its value.

A plain string is expanded to { label: value, value }, so a list of names needs no shaping.

Groups

An entry with its own items becomes a labelled run of options. A group disappears once nothing inside it matches — type cir and watch "Recent" go.

Sizes

Empty results

emptyText is the line shown when the query matches nothing. The empty slot replaces that markup entirely and receives the current query.

Create from the query

Set create to offer a row for whatever was typed when nothing matches. Choosing it emits create with the trimmed query and leaves the model alone — add the option and select it yourself.

Virtualized rows

For lists in the thousands, virtual renders only the rows on screen. The field below holds 5,000 options.

virtual cannot be combined with grouped items: groups are flattened and their labels dropped, with a warning in dev. estimateSize is the assumed row height in px, used to size the scrollbar before the rows are measured — set it when you have restyled rows to a different height.

Use virtual for lists in the thousands.

Invalid

Inside an IFormField the field passes its own validity down, so invalid rarely needs setting by hand.

Props

PropTypeDefaultDescription
items(ComboboxItemOption | ComboboxItemGroup | string)[]Options to render
placeholderstringShown while the field is empty
size'sm' | 'md' | 'lg''md'Control scale
invalidbooleanRed border and ring; inherited from IFormField when unset
idstringId for the input; IFormField supplies one
emptyTextstring'No results found.'Line shown when nothing matches
createbooleanOffer a "create" row for an unmatched query
createLabel(query: string) => stringCreate "…"Label for that row
virtualbooleanRender only the rows in view; flattens groups
estimateSizenumber32Assumed row height in px, before rows are measured
overscannumber12Rows rendered beyond the viewport on each side
unstyledbooleanDrop built-in classes
classstringMerged with the built-in classes
ui{ anchor?, input?, trigger?, content?, viewport?, item?, empty?, group?, groupLabel? }Per-slot class overrides

disabled, multiple, dir and the rest of Reka UI's ComboboxRoot props are forwarded.

Events

EventPayloadWhen
createquery: stringThe create row was chosen. The model is left alone

Reka UI's own ComboboxRoot events are re-emitted unchanged.

Slots

SlotPropsWhen to use it
empty{ query }Replace the no-results line with your own markup
create{ query }Replace the create row's label with your own markup

Item shapes

ts
interface ComboboxItemOption {
  label: string
  value: string
  disabled?: boolean
}

interface ComboboxItemGroup {
  label: string
  items: (ComboboxItemOption | string)[]
}

Attributes you set land on the input, so aria-label and friends reach the control the reader types into.