@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

Property Modifiers Type Description
disabled boolean The disabled state of the listbox.
length number The number of options.
options ListboxOption[] The list of options.
selectedIndex number The index of the selected option.
selectedOptions ListboxOption[] A collection of the selected options.
slottedOptionFilter static (n: HTMLElement) => boolean A static filter to include only selectable options.

Methods

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