SimpleBlazorMultiselect 0.2.0

dotnet add package SimpleBlazorMultiselect --version 0.2.0
                    
NuGet\Install-Package SimpleBlazorMultiselect -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SimpleBlazorMultiselect" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimpleBlazorMultiselect" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="SimpleBlazorMultiselect" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SimpleBlazorMultiselect --version 0.2.0
                    
#r "nuget: SimpleBlazorMultiselect, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=SimpleBlazorMultiselect&version=0.2.0
                    
Install SimpleBlazorMultiselect as a Cake Addin
#tool nuget:?package=SimpleBlazorMultiselect&version=0.2.0
                    
Install SimpleBlazorMultiselect as a Cake Tool

Simple blazor multiselect

NuGet Static Badge

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 to true in your Program.cs file. Alternatively you can use a cascading parameter with name Standalone 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"/>

image

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

image

<SimpleMultiselect
        Options="_items"
        @bind-SelectedOptions="_selectedItems"
        CanFilter="true"/>

image

Bootstrap dark mode

This demonstrates the dark mode of the dropdown when Bootstrap is set to dark mode. image

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last updated
0.2.0 66 3 days ago
0.1.8 2,444 11/27/2023
0.1.7 161 11/26/2023