Reference headless
select
# CreateSelectOptions
Type Parameters
V
Members
defaultOpen?optional defaultOpen?: boolean###### Inherited from
CreateSelectInput.defaultOpendefaultValue?optional defaultValue?: V | null###### Inherited from
CreateSelectInput.defaultValueid?optional id?: stringitemsitems: readonly SelectItem<V>[]###### Inherited from
CreateSelectInput.itemsonOpenChange?optional onOpenChange?: (open) => void###### Parameters
###### open
boolean###### Returns
voidonValueChange?optional onValueChange?: (value) => void###### Parameters
###### value
V|null###### Returns
void
# SelectContext
Type Parameters
V
Members
highlightedIdhighlightedId: string | nullitemsitems: readonly SelectItem<V>[]typeaheadtypeahead: stringBuffer for type-ahead search. The Layer 3 attachment resets this after a short timeout (typically 500 ms) by dispatching TYPEAHEAD.RESET.
valuevalue: V | null
# SelectController
Type Parameters
V
Members
contextreadonly context: Readonly<SelectContext<V>>highlightedIdreadonly highlightedId: string | nullidreadonly id: stringlistboxreadonly listbox: AttachmentlistboxIdreadonly listboxId: stringmachinereadonly machine: SelectMachine<V>openreadonly open: booleanstatereadonly state: SelectStatetriggerreadonly trigger: AttachmenttriggerIdreadonly triggerId: stringvaluereadonly value: V | nullhide()hide(): void###### Returns
voidoption()option(item): AttachmentoptionElementId()optionElementId(itemId): string###### Parameters
###### itemId
string###### Returns
stringselectId()selectId(id): void###### Parameters
###### id
string###### Returns
voidsetItems()setItems(items): voidsetValue()setValue(value): void###### Parameters
###### value
V|null###### Returns
voidshow()show(): void###### Returns
voidsubscribe()subscribe(listener): () => void###### Parameters
###### listener
(
snapshot) =>void###### Returns
() =>
voidtoggle()toggle(): void###### Returns
void
# SelectItem
Type Parameters
V
Members
disabled?readonly optional disabled?: boolean###### Overrides
CollectionItem.disabledidreadonly id: string###### Overrides
CollectionItem.idlabel?readonly optional label?: string###### Overrides
CollectionItem.labelvaluereadonly value: V
# Attachment
Attachment = (node) => void | (() => void)Parameters
nodeHTMLElement
Returns
void | (() => void)# SelectEvent
SelectEvent<V> = { type: "OPEN"; } | { type: "CLOSE"; } | { type: "TOGGLE"; } | { type: "ESCAPE"; } | { id: string; type: "SELECT"; } | { id: string | null; type: "HIGHLIGHT"; } | { direction: NavigateDirection; type: "NAVIGATE"; } | { char: string; type: "TYPEAHEAD"; } | { type: "TYPEAHEAD.RESET"; } | { type: "SET.VALUE"; value: V | null; } | { items: ReadonlyArray<SelectItem<V>>; type: "SET.ITEMS"; }Type Parameters
V
# SelectMachine
SelectMachine<V> = Machine<SelectContext<V>, SelectEvent<V>, SelectState>Type Parameters
V
# SelectState
SelectState = "closed" | "open"# createSelect ( )
createSelect<V>(options): SelectController<V>Type Parameters
V
Parameters
optionsCreateSelectOptions<V>
Returns
SelectController<V>