Pickers & selectors

AutoCompleteControl · StepperControl · ColorPaletteControl

Suggest as users type, guide them step by step, and let them pick a color.

Overview

AutoCompleteControl is a Blazor autocomplete that suggests matches as users type, from a list or from a callback that searches your data. Use the callback for large sets. Unlike a dropdown list, it also accepts text that matches no suggestion; for a fixed list, use DropDownListControl on Lists & dropdowns. StepperControl guides users through a process, skipping disabled steps and closing later ones while the current one is invalid, and ColorPaletteControl offers swatches in your own colors, which users move through with the arrow keys.

Examples

#Suggestions while typing

Type in both boxes: Going to filters twelve destinations itself, and Flying from asks a callback that searches 4,000 airports (try LHR, Lisbon or Iceland).

Going to

Flying from: 4,009 airports

Quote for Albus Door: no airport or destination yet. 0 airport lookups so far.

#Steps

Work through a booking: check the box under the stepper to open the next step, since an unchecked step is in InvalidSteps. No extras puts the Extras step in DisabledSteps, Vertical stacks the steps, and once the booking is confirmed CanNavigate refuses every move.

Step 1 of 4: Traveler. Check the box to open the next step.

Documentation

ParameterTypeDefaultDescription
DataSourceIEnumerable<TItem>Array.Empty<TItem>()Items to filter when OnRead is not set.
TextSelectorFunc<TItem, string>?nullText of an item. When null, TextField is read by reflection; when that is blank too, ToString().
TextFieldstring""Name of the property that holds an item's text.
Valuestring?nullThe committed text: a chosen suggestion, or typed text accepted with Enter, Tab or by leaving the box. It does not change while the user types. A new value from the page clears the suggestions.
ValueExpressionExpression<Func<string?>>?nullSet by @bind-Value; lets an enclosing form hear the change.
OnReadFunc<string, CancellationToken, Task<IEnumerable<TItem>>>?nullSupplies the suggestions for the typed text; the token is canceled by the next keystroke.
ItemTemplateRenderFragment<TItem>?nullRenders a suggestion in the popup; the default is the item's text.
MinLengthint1Characters needed before a search runs.
DebounceDelayint250Milliseconds of quiet after a keystroke before the search runs.
MaxSuggestionsint25Upper bound on the suggestions shown, at least 1.
Widthstring?nullWidth of the box. When null, the box sizes to the longer of the placeholder and the longest current suggestion, between 8 and 28 characters, so it can change as suggestions arrive. With no placeholder and no suggestions, no width is set.
AriaLabelstring?nullAccessible name of the box.
Placeholderstring?nullText shown while the box is empty.
Enabled (base)booltruefalse disables the box, closes the popup and stops searches.
Visible (base)booltruefalse hides the control with display:none.
CssClass / Style (base)string?nullOn the fx-autocomplete root, which also receives unmatched attributes.
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.