ComponentsInputs and forms
Autocomplete
A text field that searches as you type and offers matching options. Use it for long lists such as places, products or people, and when results come from a slow source that must be searched rather than loaded whole.
Search a list
SearchFunc receives the typed text and returns the options to show. An empty search usually returns everything, so the list is browsable on focus.
Nothing chosen yet.
Asynchronous search with debounce and cancellation
DebounceInterval waits for a pause before searching. When a new search starts, MudAutocomplete cancels the token of the previous one; pass it on so stale work stops.
| Searches started | 0 |
|---|---|
| Canceled by newer typing | 0 |
| Completed | 0 |
Objects and item templates
Bind records: ToStringFunc gives the field text, ItemTemplate draws each option and ItemDisabledFunc grays out options that cannot be chosen.
No instrument booked.
Strict, coerced and free text
Strict decides whether reopening filters by the selected text. CoerceValue accepts typed text that matches no option, for fields where suggestions are only a help.
Value: Comet
Value: Comet
Value: null
Minimum characters and list templates
MinCharacters delays the search until enough is typed. Templates explain an empty result, a truncated list, or offer an action below the options.
Try “the”, then “zz”.
Playground
Change any parameter; the markup below updates with only the values that differ from the defaults.
<MudAutocomplete
T="string"
@bind-Value="_destination"
SearchFunc="SearchAsync"
Label="Destination"
Variant="Variant.Outlined"
Clearable="true"
ShowProgressIndicator="true" />