Skip to main content
Version: 1.x

@microsoft/fast-foundation > Listbox

Listbox class

A Listbox Custom HTML Element. Implements the ARIA listbox.

  • The default slot for the listbox options
Signature:
export declare abstract class Listbox extends FoundationElement 

Properties

PropertyModifiersTypeDescription
disabledbooleanThe disabled state of the listbox.
lengthnumberThe number of options.
optionsListboxOption[]The list of options.
selectedIndexnumberThe index of the selected option.
selectedOptionsListboxOption[]A collection of the selected options.
slottedOptionFilterstatic(n: HTMLElement) => booleanA static filter to include only selectable options.

Methods

MethodModifiersDescription
selectFirstOption()Moves focus to the first selectable option.
setSelectedOptions()Sets an option as selected and gives it focus.