A lightweight, customizable Multiselect component built with Blazor. Easily select multiple options from a dropdown with support for search, custom templates, and more.
β¨ Features
β
Select multiple options from a dropdown
π Optional search/filter support
π¨ Customizable item templates
π§© Supports binding to complex data types
π Getting Started
- Add the following to your
_Imports.razor
file:@using MultiSelectPackage.Components
See the project MultiSelectPackage
for more examples of how to use the component
<MultiSelect T="DummyDataDto"
Items="DummyData"
DisplayProperty="FullName"
IdentifierProperty="Id"
ValuesChanged="OnSelectedItemsChanged"
CanSearch="true"
SearchPlaceHolder="Search..."
CustomStyle=""
Width="35%" />
public class DummyDataDto
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Surname { get; set; } = string.Empty;
public string FullName
{
get
{
return $"{Name} {Surname}";
}
}
}
public void OnSelectedItemsChanged(List<DummyDataDto> items)
{
try
{
selectedItems = items;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}