sheengemologic ui
All components

Combobox

Editable single selection with retained async results.@gemologic/sheen · forms

Playground

<Combobox label="Owner" options={[{ value: "ada", label: "Ada" }]} defaultValue="ada"  filter="contains"/>

Variant matrix

App-owned results
filter: contains
filter: startsWith
filter: endsWith
filter: false

Anatomy

Package
@gemologic/sheen
Source
packages/ui/src/primitives/Combobox.tsx
Tokens
  • --sheen-color-bg-inset
  • --sheen-color-bg-raised
  • --sheen-color-border-control
  • --sheen-color-focus-ring

Accessibility

Role: comboboxKeyboard: ArrowDown, ArrowUp, Home, End, Enter, Escape

Do

  • Set pending before replacing externally fetched options, then publish the accepted result set atomically.

Do not

  • Do not commit free-form query text as the selected value.

Generated props

NameTypeDefaultDescription
valuestring | nullControlled selected value; null explicitly clears selection.
defaultValuestring | nullInitial uncontrolled selected value.
onValueChange(value: string | null) => voidReceives committed option values, never free-form input.
label *stringRequired visible label.
options *readonly ComboboxOption[]Accepted options with unique nonempty values and labels.
namestringNative hidden-select form name.
formstringOptional external form ID.
placeholderstringText shown while the editable input is empty.
descriptionstringSupporting text associated with the input.
errorstringField validation text and invalid state.
disabledbooleanfalseDisables input, selection, and submission.
readOnlybooleanfalseAllows inspection but rejects edits.
requiredbooleanfalseRequires a committed selection for native form submission.
filterComboboxFiltercontainsBuilt-in label filter, or false when the app supplies externally filtered options.
onInputChange(value: string) => voidReceives editable query changes; the app owns debounce, cancellation, and request ordering.
pendingbooleanfalseRetains the last accepted result nodes and prevents stale selection while the next result set is pending.
resultsErrorstringNonblocking async-result error; field validation remains separate.
onRetry() => voidOptional retry action shown with resultsError.
inputRef(element: HTMLInputElement) => voidReceives the visible native input.
Native Solid/HTML attributes remain available and are omitted from this authored-prop view.