Share via


Combobox

Choose a programming language

The W3C definition:

A combobox is an input widget with an associated popup that enables users to select a value for the combobox from a collection of possible values. In some implementations, the popup presents allowed values, while in other implementations, the popup presents suggested values, and users may either select one of the suggestions or type a value. The popup may be a listbox, grid, tree, or dialog. Many implementations also include a third optional element -- a graphical Open button adjacent to the combobox, which indicates availability of the popup. Activating the Open button displays the popup if suggestions are available.

fluent-combobox

Setup

Basic Setup

TypeScript
import {
    provideFluentDesignSystem,
    fluentCombobox,
    fluentOption
} from "@fluentui/web-components";

provideFluentDesignSystem()
    .register(
        fluentCombobox(),
        fluentOption()
    );

Customizing the indicator

TypeScript
import {
    provideFluentDesignSystem,
    fluentCombobox,
    fluentOption
} from "@fluentui/web-components";

provideFluentDesignSystem()
    .register(
        fluentCombobox({
          indicator: `...your indicator...`
        }),
        fluentOption()
    );

Example

FluentCombobox

<FluentCombobox> wraps the <fluent-combobox> element, a web component implementation of a combobox.

Usage

razor
@using Microsoft.Fast.Components.FluentUI
<FluentCombobox>
    <FluentOption>Extra Small</FluentOption>
    <FluentOption>Small</FluentOption>
    <FluentOption>Medium</FluentOption>
    <FluentOption>Large</FluentOption>
    <FluentOption>Extra Large</FluentOption>
</FluentCombobox>

Example

See the component in action with implementation examples at the Blazor demo site.


Additional resources

Documentation

  • dialog

    Demo of the Dialog Fluent UI Web Component

  • Menu

    Demo of the Menu Fluent UI Web Component

  • Data Grid

    Demo of the Data Grid Fluent UI Web Component

Training

Module

Interact with data in Blazor web apps - Training

Learn how to create a graphical user interface in a Blazor web app by creating and assembling Blazor components. Access data and share it for display on multiple pages within your app.