Skip to main content

fast-listbox

An implementation of a listbox. While any DOM content is permissible as a child of the listbox, only fast-option elements, option elements, and slotted items with role="option" will be treated as options and receive keyboard support.

The listbox component has no internals related to form association. For a form-associated listbox, see the fast-select component.

Setup#

import {    provideFASTDesignSystem,    fastListbox,    fastOption,} from "@microsoft/fast-components";
provideFASTDesignSystem().register(fastListbox(), fastOption());

Usage#

Live Editor
Result
SyntaxError: Unexpected token (1:8)
1 : return ()
            ^

Create your own design#

Listbox#

import { Listbox, listboxTemplate as template } from "@microsoft/fast-foundation";import { listboxStyles as styles } from "./my-listbox.styles";
export const myListbox = Listbox.compose({    baseName: "listbox",    template,    styles,});

Option#

See listbox-option for more information.

Additional resources#