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 | null—Controlled selected value; null explicitly clears selection.
defaultValuestring | null—Initial uncontrolled selected value.
onValueChange(value: string | null) => void—Receives committed option values, never free-form input.
label *string—Required visible label.
options *readonly ComboboxOption[]—Accepted options with unique nonempty values and labels.
namestring—Native hidden-select form name.
formstring—Optional external form ID.
placeholderstring—Text shown while the editable input is empty.
descriptionstring—Supporting text associated with the input.
errorstring—Field 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) => void—Receives 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.
resultsErrorstring—Nonblocking async-result error; field validation remains separate.
onRetry() => void—Optional retry action shown with resultsError.
inputRef(element: HTMLInputElement) => void—Receives the visible native input.
Native Solid/HTML attributes remain available and are omitted from this authored-prop view.