SimpleBlazorMultiselect 0.2.0
dotnet add package SimpleBlazorMultiselect --version 0.2.0
NuGet\Install-Package SimpleBlazorMultiselect -Version 0.2.0
<PackageReference Include="SimpleBlazorMultiselect" Version="0.2.0" />
<PackageVersion Include="SimpleBlazorMultiselect" Version="0.2.0" />
<PackageReference Include="SimpleBlazorMultiselect" />
paket add SimpleBlazorMultiselect --version 0.2.0
#r "nuget: SimpleBlazorMultiselect, 0.2.0"
#addin nuget:?package=SimpleBlazorMultiselect&version=0.2.0
#tool nuget:?package=SimpleBlazorMultiselect&version=0.2.0
Simple blazor multiselect
This package contains a simple Blazor dropdown component that supports single and multiple selection. It is compatible with Bootstrap in the sense that if you include Bootstrap in your project, the dropdown will look and feel like a Bootstrap dropdown including dark mode.
Installation
You can find the Nuget package here, install it using the following command:
dotnet add package SimpleBlazorMultiselect
[!IMPORTANT] If you want to use the project without Bootstrap, set
SimpleMultiselectGlobals.Standalone
totrue
in yourProgram.cs
file. Alternatively you can use a cascading parameter with nameStandalone
around the component.
Usage
See the project SimpleBlazorMultiselectDemo
for more examples of how to use the component,
or take a look at the properties page on the wiki.
You can also view a live demo here.
Below are some short examples, they all use the following @code
block:
@code {
private readonly List<string> _items = ["Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9", "Item 10" ];
private HashSet<string> _selectedItems = new();
}
Basic dropdown
<SimpleMultiselect
Options="_items"
@bind-SelectedOptions="_selectedItems"/>
Dropdown with custom item template
<SimpleMultiselect
Options="_items"
@bind-SelectedOptions="_selectedItems">
<SelectedOptionsRenderer Context="options">
@foreach (var item in options)
{
<span
class="badge bg-primary"
style="padding: 6px; margin-right: 10px;">
@item
</span>
}
</SelectedOptionsRenderer>
</SimpleMultiselect>
Dropdown with filter
<SimpleMultiselect
Options="_items"
@bind-SelectedOptions="_selectedItems"
CanFilter="true"/>
Bootstrap dark mode
This demonstrates the dark mode of the dropdown when Bootstrap is set to dark mode.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.