Skip to content
Shiny .NET v4.1 BETA - Linux, MacOS, & Blazor Support! TONS of new features and improvements across the board. Check It Out

AutoCompleteEntry

A text input with debounced search, dropdown suggestions, busy indicator, and custom item templates. Supports both local filtering and remote search via a command/callback. Fully styleable on both MAUI (bindable properties) and Blazor (CSS custom properties).

  • NuGet downloads for Shiny.Maui.Controls
  • NuGet downloads for Shiny.Blazor.Controls
Frameworks
.NET MAUI
Blazor
AutoCompleteEntry

Provide an ItemsSource without a SearchCommand — the control filters items locally as the user types:

<shiny:AutoCompleteEntry
Text="{Binding SearchText}"
Placeholder="Search fruits..."
ItemsSource="{Binding AllFruits}"
SelectedItem="{Binding SelectedFruit}"
TextMemberPath="Name" />

Set SearchCommand to trigger an async search. Bind IsBusy to show the spinner during loading:

<shiny:AutoCompleteEntry
Text="{Binding SearchText}"
Placeholder="Search..."
ItemsSource="{Binding Results}"
SelectedItem="{Binding SelectedResult}"
SearchCommand="{Binding SearchCommand}"
IsBusy="{Binding IsSearching}"
TextMemberPath="Name"
DebounceInterval="400"
Threshold="2" />
PropertyTypeDefaultDescription
Textstring""Current text value (TwoWay)
Placeholderstring?nullPlaceholder text
PlaceholderColorColor? / string?nullPlaceholder color
ItemsSourceIListnullSuggestion items
SelectedItemobject?nullSelected item (TwoWay)
SearchCommandICommand / EventCallback<string>nullAsync search trigger
TextMemberPathstring?nullProperty name to display from complex objects
ItemTemplateDataTemplate / RenderFragment<object>nullCustom dropdown item rendering
IsBusyboolfalseShow/hide loading spinner (TwoWay)
DebounceIntervalint300Debounce delay in milliseconds
Thresholdint1Minimum characters before searching
MaxDropDownHeightdouble200Maximum dropdown height (px)
TextColorColor? / string?nullInput text color
FontSizedouble14Input font size
FontFamilystring?nullFont family (MAUI only)
FontAttributesFontAttributesNoneBold/italic (MAUI only)
DropDownBackgroundColorColor? / string?WhiteDropdown background
DropDownBorderColorColor? / string?LightGrayDropdown border color
CornerRadiusdouble4Dropdown border radius (MAUI only)
SpinnerColorColor? / string?GreyLoading spinner color
ShowAllOnFocusboolfalseShow all unfiltered items when the input is focused (local filtering only)
EventArgsDescription
ItemSelectedobject?Fires when a suggestion is selected from the dropdown
<shiny:AutoCompleteEntry
FontSize="18"
FontFamily="OpenSans"
FontAttributes="Bold"
TextColor="Black"
PlaceholderColor="DarkGray"
DropDownBackgroundColor="#F9FAFB"
DropDownBorderColor="#6B7280"
SpinnerColor="DodgerBlue"
CornerRadius="12"
MaxDropDownHeight="300" />
var autoComplete = new AutoCompleteEntry
{
TextMemberPath = nameof(Product.Name),
FontSize = 16,
CornerRadius = 8,
ItemTemplate = new DataTemplate(() =>
{
var grid = new Grid
{
ColumnDefinitions =
{
new ColumnDefinition(GridLength.Star),
new ColumnDefinition(GridLength.Auto)
},
Padding = new Thickness(8, 6)
};
var name = new Label { FontSize = 14 };
name.SetBinding(Label.TextProperty, nameof(Product.Name));
var price = new Label { FontSize = 12, TextColor = Colors.Grey };
price.SetBinding(Label.TextProperty, nameof(Product.PriceDisplay));
grid.Add(name, 0, 0);
grid.Add(price, 1, 0);
return grid;
})
};
<AutoCompleteEntry
Text="@searchText"
TextChanged="v => searchText = v"
Placeholder="Search..."
ItemsSource="@results"
SelectedItemChanged="OnSelected"
SearchCommand="OnSearch"
IsBusy="@isBusy"
TextMemberPath="Name"
DebounceInterval="400"
Threshold="2"
FontSize="16"
TextColor="#333"
DropDownBackgroundColor="#fff"
DropDownBorderColor="#ccc"
SpinnerColor="#3B82F6"
InputClass="my-input"
DropDownClass="my-dropdown">
<ItemTemplate Context="item">
@{ var p = (Product)item; }
<div style="display:flex;justify-content:space-between;">
<span>@p.Name</span>
<span style="color:#888;">@p.PriceDisplay</span>
</div>
</ItemTemplate>
</AutoCompleteEntry>
@code {
string searchText = "";
bool isBusy;
IList? results;
async Task OnSearch(string query)
{
isBusy = true;
results = await MyApi.SearchAsync(query);
isBusy = false;
}
void OnSelected(object? item)
{
if (item is Product p) { /* handle selection */ }
}
}
PropertyTypeDefaultDescription
CssClassstring?nullCSS class applied to root element
InputClassstring?nullCSS class applied to the input element
DropDownClassstring?nullCSS class applied to the dropdown
AdditionalAttributesIDictionary<string, object>?nullUnmatched HTML attributes passed to root element

Override these on a parent element or the component’s root to theme without parameters:

VariableDefaultControls
--shiny-ac-textinheritInput text color
--shiny-ac-ph#9CA3AFPlaceholder color
--shiny-ac-dd-bg#fffDropdown background
--shiny-ac-dd-border#D1D5DBDropdown border
--shiny-ac-spinner#9CA3AFSpinner color
--shiny-ac-font-sizeinheritInput font size
--shiny-ac-dd-max-h200pxDropdown max height

Example — dark theme a section without touching individual components:

.dark-section {
--shiny-ac-text: #f0f0f0;
--shiny-ac-ph: #888;
--shiny-ac-dd-bg: #1e1e1e;
--shiny-ac-dd-border: #444;
--shiny-ac-spinner: #60A5FA;
}
claude plugin marketplace add shinyorg/skills
claude plugin install shiny-controls@shiny
copilot plugin marketplace add https://github.com/shinyorg/skills
copilot plugin install shiny-controls@shiny
View shiny-controls Plugin