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

Parameter Description TypeDefault
AriaDescribedBy

Specifies the aria-describedby attribute value.

Remarks

When set, this value is rendered as-is and overrides help and validation message ids generated by Field and Validation.

string
AriaInvalid

Specifies the aria-invalid attribute value.

Remarks

When set, this value is rendered as-is and overrides the validation-derived aria-invalid state.

string
AriaLabelledBy

Specifies the aria-labelledby attribute value.

Remarks

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

string
AriaRequired

Specifies the aria-required attribute value.

Remarks

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

boolfalse
Autofocus

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

boolfalse
AutoPreSelect

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

booltrue
AutoSelectFirstItem

Specifies the whether first item in the list should be selected

boolfalse
ChildContent

Specifies the content to be rendered inside this Autocomplete.

RenderFragmentnull
CloseOnSelection

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

booltrue
CloseParentDropdowns

Specifies a value indicating whether parent dropdown menus should be closed when this component is activated.

Remarks

Set this property to 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.

boolfalse
ConfirmKey

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" }.

Remarks

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'.

string[]new[] { "Enter", "NumpadEnter" }
Data

Specifies the autocomplete data source.

IEnumerable<TItem>null
Debounce

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

bool?null
DebounceInterval

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

int?null
Disabled

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

boolfalse
Feedback

Placeholder for validation messages.

RenderFragmentnull
Filter

Specifies the method by which the search will be done.

Possible values:StartsWith, Contains

AutocompleteFilterAutocompleteFilter.StartsWith
FreeTyping

Allows the value to not be on the data source. The value will be bound to the SelectedText

boolfalse
FreeTypingNotFoundTemplate

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

RenderFragment<string>null
HighlightSearch

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

boolfalse
Immediate

If true the text in will be changed after each key press.

Remarks

Note that setting this will override global settings in Immediate.

bool?null
ItemContent

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

RenderFragment<ItemContext<TItem, TValue>>null
MaxEntryLength

Specifies the maximum number of characters allowed in the input element.

int?null
MaxMenuHeight

Sets the maximum height of the dropdown menu.

string
MinSearchLength

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.

int1
MultipleBadgeColor

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

ColorPrimary
MultipleDisabledBadgeColor

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

ColorLight
NotFoundTemplate

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

RenderFragment<string>null
Placeholder

Sets the placeholder for the empty search.

string
PositionStrategy

Specifies the positioning strategy of the dropdown menu as a 'floating' element.

Possible values:Absolute, Fixed

DropdownPositionStrategyAbsolute
ReadOnly

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

boolfalse
Search

Specifies the currently selected item text.

string
SearchBackground

Specifies the background color of the search field.

Backgroundnull
SearchClass

Specifies class for search field.

string
SearchStyle

Specifies style for search field.

string
SearchTextColor

Specifies the text color of the search field.

TextColornull
SelectedText

Specifies the currently selected item text.

string
SelectedTextExpression

Specifies an expression that identifies the selected text.

Expression<Func<string>>null
SelectedTexts

Currently selected items texts. Used when multiple selection is set.

List<string>null
SelectedTextsExpression

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

Expression<Func<List<string>>>null
SelectedValue

Currently selected item value.

TValuenull
SelectedValueExpression

Specifies an expression that identifies the selected value.

Expression<Func<TValue>>null
SelectedValues

Currently selected items values. Used when multiple selection is set.

List<TValue>null
SelectedValuesExpression

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

Expression<Func<List<TValue>>>null
SelectionMode

Specifies the Autocomplete Selection Mode.

Possible values:Default, Multiple, Checkbox

AutocompleteSelectionModeAutocompleteSelectionMode.Default
Size

Sets the size of the input control.

Size?null
SuggestSelectedItems

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

boolfalse
TabIndex

If defined, indicates that its element can be focused and can participates in sequential keyboard navigation.

int?null
TagTemplate

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

RenderFragment<AutocompleteTagContext<TItem, TValue>>null
TotalItems

Specifies the total number of items available when data is loaded through ReadData.

Remarks

This field must be set only when ReadData and Virtualize is used to load the data.

int?null
Value

Specifies the value inside the input field.

TValuenull
ValueExpression

Specifies an expression that identifies the input value.

Expression<Func<TValue>>null
Virtualize

Determines whether the Autocomplete will use the Virtualize functionality.

boolfalse

Events

Event Description Type
Blur

The blur event fires when an element has lost focus.

EventCallback<FocusEventArgs>
Closed

Event handler used to detect when the autocomplete is closed.

EventCallback<AutocompleteClosedEventArgs>
CustomFilter

Handler for custom filtering on Autocomplete's data source.

Func<TItem, string, bool>
CustomValidationValue

Used to provide custom validation value on which the validation will be processed with the Validator handler.

Remarks

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.

Func<TValue>
DisabledItem

Method used to get the determine if the item should be disabled.

Func<TItem, bool>
FocusIn

Notifies when the input box gains focus.

EventCallback<FocusEventArgs>
FocusOut

Notifies when the input box loses focus.

EventCallback<FocusEventArgs>
KeyDown

Notifies when a key is pressed down while the control has focus.

EventCallback<KeyboardEventArgs>
KeyPress

Notifies when a key is pressed while the control has focus.

EventCallback<KeyboardEventArgs>
KeyUp

Notifies when a key is released while the control has focus.

EventCallback<KeyboardEventArgs>
NotFound

Occurs on every search text change where the data does not contain the text being searched.

EventCallback<string>
OnFocus

Notifies when the input box gains or loses focus.

EventCallback<FocusEventArgs>
Opened

Event handler used to detect when the autocomplete is opened.

EventCallback
ReadData

Event handler used to load data manually based on the current search value.

EventCallback<AutocompleteReadDataEventArgs>
SearchBlur

The blur event fires when the search box has lost focus.

EventCallback<FocusEventArgs>
SearchChanged

Occurs on every search text change.

EventCallback<string>
SearchFocus

Notifies when the search box gains or loses focus.

EventCallback<FocusEventArgs>
SearchKeyDown

Notifies when a key is pressed down while the search box has focus.

EventCallback<KeyboardEventArgs>
SearchTextChanged

Occurs after the search box text has changed.

EventCallback<string>
SelectedTextChanged

Specifies the currently selected item text.

EventCallback<string>
SelectedTextsChanged

Occurs after the selected texts have changed. Used when multiple selection is set.

EventCallback<List<string>>
SelectedValueChanged

Occurs after the selected value has changed.

EventCallback<TValue>
SelectedValuesChanged

Occurs after the selected values have changed. Used when multiple selection is set.

EventCallback<List<TValue>>
TextField

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

Func<TItem, string>
ValueChanged

Occurs after value has changed.

EventCallback<TValue>
ValueField

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

Func<TItem, TValue>

Methods

Method DescriptionReturnParameters
AddMultipleTextAndValue Adds a Multiple Selection. TaskTValue value
Clear Clears the selected value and the search field. Task
Close Closes the Autocomplete Dropdown. Task
Close Closes the Autocomplete Dropdown. TaskCloseReason closeReason
GetItemByText Gets a from Data by using the provided TextField. TItemstring text
GetItemByValue Gets a from Data by using the provided ValueField. TItemTValue value
GetItemsByText Gets multiple items from Data by using the provided TextField. IEnumerable<TItem>string text
IsSelectedItem Gets whether the is selected. boolTItem item
IsSelectedvalue Gets whether the is selected. boolTValue value
OpenDropdown Opens the Autocomplete Dropdown. Task
Reload Triggers the reload of the Autocomplete data. Makes sure not to reload if the Autocomplete is in a loading state. TaskCancellationToken cancellationToken
RemoveMultipleTextAndValue Removes a Multiple Selection. Taskstring text
RemoveMultipleTextAndValue Removes a Multiple Selection. TaskTValue value
ResetSelected Clears the current selection. Task
ScrollItemIntoView Scrolls an item into view. Taskint index
Focus Sets the focus on the underline element. Taskbool scrollToElement
Revalidate Forces the Validation (if any is used) to re-validate with the new custom or internal value. Task
On this page