Blazorise Autocomplete API

Explore the Blazorise Autocomplete API reference for parameters, events, methods, and related types.

For examples and usage guidance, see the Autocomplete documentation.

API

Parameters

ParameterDefaultType
AriaDescribedBy—string

Specifies the aria-describedby attribute value.
When set, this value is rendered as-is and overrides help and validation message ids generated by Field and Validation.
AriaInvalid—string

Specifies the aria-invalid attribute value.
When set, this value is rendered as-is and overrides the validation-derived aria-invalid state.
AriaLabelledBy—string

Specifies the aria-labelledby attribute value.
When set, this value is rendered as-is. Some non-labelable controls can otherwise derive it automatically from a parent FieldLabel or FieldsLabel.
AriaRequiredfalsebool

Specifies the aria-required attribute value.
When set, this value overrides the required-field state resolved from the parent Validation.
Autofocusfalsebool

Set's the focus to the component after the rendering is done.
AutoPreSelecttruebool

Determines whether Autocomplete auto preselects the first item displayed on the dropdown. Defauls to true.
AutoSelectFirstItemfalsebool

Specifies the whether first item in the list should be selected
ChildContentnullRenderFragment

Specifies the content to be rendered inside this Autocomplete.
CloseOnSelectiontruebool

Specifies whether Autocomplete dropdown closes on selection. This is only evaluated when multiple selection is set. Defauls to true.
CloseParentDropdownsfalsebool

Specifies a value indicating whether parent dropdown menus should be closed when this component is activated.
Set this property to true to automatically close any open parent dropdowns when the component is triggered. This can be useful for ensuring only one dropdown is open at a time in nested menu scenarios.
ConfirmKeynew[] { "Enter", "NumpadEnter" }string[]

Specifies an array of the keyboard pressed values for the ConfirmKey. If this is null or empty, there will be no confirmation key.

Defauls to: { "Enter", "NumpadEnter", "Tab" }.

If the value has a printed representation, this attribute's value is the same as the char attribute. Otherwise, it's one of the key value strings specified in 'Key values'.
DatanullIEnumerable<TItem>

Specifies the autocomplete data source.
Debouncenullbool?

If true the entered text will be slightly delayed before submitting it to the internal value.
DebounceIntervalnullint?

Interval in milliseconds that entered text will be delayed from submitting to the internal value.
Disabledfalsebool

Add the disabled boolean attribute on an input to prevent user interactions and make it appear lighter.
FeedbacknullRenderFragment

Placeholder for validation messages.
FilterStartsWithAutocompleteFilter

Specifies the method by which the search will be done.
Possible values:StartsWithContains
FreeTypingfalsebool

Allows the value to not be on the data source. The value will be bound to the SelectedText
FreeTypingNotFoundTemplatenullRenderFragment<string>

Specifies the not found content to be rendered inside this Autocomplete when no data is found and FreeTyping is enabled.
HighlightSearchfalsebool

If true, the searched text will be highlighted in the dropdown list items based on Search value.
Immediatenullbool?

If true the text in will be changed after each key press.
Note that setting this will override global settings in Immediate.
ItemContentnullRenderFragment<ItemContext<TItem, TValue>>

Specifies the item content to be rendered inside each dropdown item.
MaxEntryLengthnullint?

Specifies the maximum number of characters allowed in the input element.
MaxMenuHeight—string

Sets the maximum height of the dropdown menu.
MinSearchLength1int

The minimum number of characters a user must type before a search is performed. Set this to 0 to make the Autocomplete function like a dropdown.
MultipleBadgeColorPrimaryColor

Sets the Badge color for the multiple selection values. Used when multiple selection is set.
MultipleDisabledBadgeColorLightColor

Sets the disabled Badge color for the multiple selection values. Used when multiple selection is set.
NotFoundTemplatenullRenderFragment<string>

Specifies the not found template to be rendered inside this Autocomplete when no data is found.
Placeholder—string

Sets the placeholder for the empty search.
PositionStrategyAbsoluteDropdownPositionStrategy

Specifies the positioning strategy of the dropdown menu as a 'floating' element.
Possible values:AbsoluteFixed
ReadOnlyfalsebool

Add the readonly boolean attribute on an input to prevent modification of the input’s value.
Search""string

Specifies the currently selected item text.
SearchBackgroundnullBackground

Specifies the background color of the search field.
SearchClass—string

Specifies class for search field.
SearchStyle—string

Specifies style for search field.
SearchTextColornullTextColor

Specifies the text color of the search field.
SelectedText—string

Specifies the currently selected item text.
SelectedTextExpressionnullExpression<Func<string>>

Specifies an expression that identifies the selected text.
SelectedTextsnullList<string>

Currently selected items texts. Used when multiple selection is set.
SelectedTextsExpressionnullExpression<Func<List<string>>>

Specifies an expression that identifies the selected texts. Used when multiple selection is set.
SelectedValuenullTValue

Currently selected item value.
SelectedValueExpressionnullExpression<Func<TValue>>

Specifies an expression that identifies the selected value.
SelectedValuesnullList<TValue>

Currently selected items values. Used when multiple selection is set.
SelectedValuesExpressionnullExpression<Func<List<TValue>>>

Specifies an expression that identifies the selected values. Used when multiple selection is set.
SelectionModeDefaultAutocompleteSelectionMode

Specifies the Autocomplete Selection Mode.
Possible values:DefaultMultipleCheckbox
SizeDefaultSize?

Sets the size of the input control.
When omitted, uses the parent Addons size, then the theme input size, then Size.Default.
SuggestSelectedItemsfalsebool

Suggests already selected option(s) when presenting the options.
TabIndexnullint?

If defined, indicates that its element can be focused and can participates in sequential keyboard navigation.
TagTemplatenullRenderFragment<AutocompleteTagContext<TItem, TValue>>

Specifies the content to be rendered for each tag (multiple selected item).
TotalItemsnullint?

Specifies the total number of items available when data is loaded through ReadData.
This field must be set only when ReadData and Virtualize is used to load the data.
ValuenullTValue

Specifies the value inside the input field.
ValueExpressionnullExpression<Func<TValue>>

Specifies an expression that identifies the input value.
Virtualizefalsebool

Determines whether the Autocomplete will use the Virtualize functionality.

Events

EventType
BlurEventCallback<FocusEventArgs>

The blur event fires when an element has lost focus.
ClosedEventCallback<AutocompleteClosedEventArgs>

Event handler used to detect when the autocomplete is closed.
CustomFilterFunc<TItem, string, bool>

Handler for custom filtering on Autocomplete's data source.
CustomValidationValueFunc<TValue>

Used to provide custom validation value on which the validation will be processed with the Validator handler.
Should be used carefully as it's only meant for some special cases when input is used in a wrapper component, like Autocomplete or SelectList.
DisabledItemFunc<TItem, bool>

Method used to get the determine if the item should be disabled.
FocusInEventCallback<FocusEventArgs>

Notifies when the input box gains focus.
FocusOutEventCallback<FocusEventArgs>

Notifies when the input box loses focus.
KeyDownEventCallback<KeyboardEventArgs>

Notifies when a key is pressed down while the control has focus.
KeyPressEventCallback<KeyboardEventArgs>

Notifies when a key is pressed while the control has focus.
KeyUpEventCallback<KeyboardEventArgs>

Notifies when a key is released while the control has focus.
NotFoundEventCallback<string>

Occurs on every search text change where the data does not contain the text being searched.
OnFocusEventCallback<FocusEventArgs>

Notifies when the input box gains or loses focus.
OpenedEventCallback

Event handler used to detect when the autocomplete is opened.
ReadDataEventCallback<AutocompleteReadDataEventArgs>

Event handler used to load data manually based on the current search value.
SearchBlurEventCallback<FocusEventArgs>

The blur event fires when the search box has lost focus.
SearchChangedEventCallback<string>

Occurs on every search text change.
SearchFocusEventCallback<FocusEventArgs>

Notifies when the search box gains or loses focus.
SearchKeyDownEventCallback<KeyboardEventArgs>

Notifies when a key is pressed down while the search box has focus.
SearchTextChangedEventCallback<string>

Occurs after the search box text has changed.
SelectedTextChangedEventCallback<string>

Specifies the currently selected item text.
SelectedTextsChangedEventCallback<List<string>>

Occurs after the selected texts have changed. Used when multiple selection is set.
SelectedValueChangedEventCallback<TValue>

Occurs after the selected value has changed.
SelectedValuesChangedEventCallback<List<TValue>>

Occurs after the selected values have changed. Used when multiple selection is set.
TextFieldFunc<TItem, string>

Method used to get the display field from the supplied data source.
ValueChangedEventCallback<TValue>

Occurs after value has changed.
ValueFieldFunc<TItem, TValue>

Method used to get the value field from the supplied data source.

Methods

MethodReturnParameters
AddMultipleTextAndValueTaskTValue value

Adds a Multiple Selection.
ClearTask—

Clears the selected value and the search field.
CloseTask—

Closes the Autocomplete Dropdown.
CloseTaskCloseReason closeReason

Closes the Autocomplete Dropdown.
GetItemByTextTItemstring text

Gets a TItem from Data by using the provided TextField.
GetItemByValueTItemTValue value

Gets a TItem from Data by using the provided ValueField.
GetItemsByTextIEnumerable<TItem>string text

Gets multiple items from Data by using the provided TextField.
IsSelectedItemboolTItem item

Gets whether the TItem is selected.
IsSelectedvalueboolTValue value

Gets whether the TValue is selected.
OpenDropdownTask—

Opens the Autocomplete Dropdown.
ReloadTaskCancellationToken cancellationToken

Triggers the reload of the Autocomplete data. Makes sure not to reload if the Autocomplete is in a loading state.
RemoveMultipleTextAndValueTaskstring text

Removes a Multiple Selection.
RemoveMultipleTextAndValueTaskTValue value

Removes a Multiple Selection.
ResetSelectedTask—

Clears the current selection.
ScrollItemIntoViewTaskint index

Scrolls an item into view.
FocusTaskbool scrollToElement

Sets the focus on the underline element.
RevalidateTask—

Forces the Validation (if any is used) to re-validate with the new custom or internal value.
On this page