s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All UI components

Forms and controls

Combobox

No summary has been written for Combobox. Everything below is generated from the declaration shipped in 0.57.40 and describes the real contract.

Public export

typescript
import { Combobox } from '@happyvertical/smrt-ui/forms';
Import path
@happyvertical/smrt-ui/forms
Props
19
Props described
19 of 19
Bindable state
0
Callback events
2
Verified release
0.57.40

Props

NameTypeRequiredDescription
optionsControlOption[]YesArray of options to select from.
valuestringNoCurrently selected option value (bindable).
labelstringYesLabel for the combobox control.
namestringNoHTML form field name.
placeholderstringNoPlaceholder text shown when value is empty.
disabledbooleanNoWhether the control is disabled.
requiredbooleanNoWhether the control is required.
allowCustombooleanNoWhether users can enter values not in the options list.
interactionControlInteractionOptions | falseNoInteraction options or false to disable all.
valueLabelstringNoLabel for `value` while its option is not in `options` yet (options load asynchronously, or only the current record is known). Without it the field stays empty rather than flashing the raw value (an id).
filterbooleanNoWhether typing filters `options` by label. Set `false` when the caller supplies the matching options itself (server-side search via `onquery`), so a result that matched on something other than its label stays listed.
onquery(query: string) => voidNoCalled with the text to search for when the list opens (empty) and on every keystroke. Pair with `filter={false}` and fresh `options`.
statusstringNoMessage announced politely to assistive technology while the list is open ("Searching…", "3 results", "No results"). It is also shown inside the list while there are no options to list.
busybooleanNoMarks the combobox busy while options are being fetched.
invalidbooleanNoMarks the field invalid (`aria-invalid`).
describedbystringNoIds of elements describing the field (error text, hints).
optionContentSnippet<[ControlOption]>NoCustom content for one option row; defaults to the label.
onvaluechange(value: string) => voidNoCallback when the selected value changes.
classstringNoCSS class to apply to the combobox container.

Bindable state

This component has no bindable public state.

Callback events

  • onquery(query: string) => void
  • onvaluechange(value: string) => void

Examples and explanation