` of your `App.razor` or `index.html` file:
```html
-
-
+
+
```
## 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](https://github.com/BorisGerretzen/SimpleBlazorMultiselect/wiki/Properties).
+The demo project is hosted on [GitHub Pages](https://borisgerretzen.github.io/SimpleBlazorMultiselect/).
Below are some short examples, they all use the following `@code` block:
```csharp
diff --git a/SimpleBlazorMultiselect.sln b/SimpleBlazorMultiselect.sln
index 7df1c1d..6981d47 100644
--- a/SimpleBlazorMultiselect.sln
+++ b/SimpleBlazorMultiselect.sln
@@ -1,10 +1,10 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleBlazorMultiselect", "SimpleBlazorMultiselect\SimpleBlazorMultiselect.csproj", "{AEFF45E1-DA9E-427F-908F-2C142523BDAA}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{49DA0B6E-92AE-41C0-8763-16D0303F2015}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleBlazorMultiselectDemo", "SimpleBlazorMultiselectDemo\SimpleBlazorMultiselectDemo.csproj", "{B04E859C-9794-41AC-BD91-4544276A5FC8}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleBlazorMultiselect", "src\SimpleBlazorMultiselect\SimpleBlazorMultiselect.csproj", "{1F3DCC28-1FD5-4F3C-B43D-564A44DBE398}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{49DA0B6E-92AE-41C0-8763-16D0303F2015}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleBlazorMultiselect.Demo", "src\SimpleBlazorMultiselect.Demo\SimpleBlazorMultiselect.Demo.csproj", "{025632E8-CB51-4E49-B47C-B9C75D35A874}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -14,13 +14,13 @@ Global
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{49DA0B6E-92AE-41C0-8763-16D0303F2015}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{49DA0B6E-92AE-41C0-8763-16D0303F2015}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AEFF45E1-DA9E-427F-908F-2C142523BDAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AEFF45E1-DA9E-427F-908F-2C142523BDAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AEFF45E1-DA9E-427F-908F-2C142523BDAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AEFF45E1-DA9E-427F-908F-2C142523BDAA}.Release|Any CPU.Build.0 = Release|Any CPU
- {B04E859C-9794-41AC-BD91-4544276A5FC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B04E859C-9794-41AC-BD91-4544276A5FC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B04E859C-9794-41AC-BD91-4544276A5FC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B04E859C-9794-41AC-BD91-4544276A5FC8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1F3DCC28-1FD5-4F3C-B43D-564A44DBE398}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1F3DCC28-1FD5-4F3C-B43D-564A44DBE398}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1F3DCC28-1FD5-4F3C-B43D-564A44DBE398}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1F3DCC28-1FD5-4F3C-B43D-564A44DBE398}.Release|Any CPU.Build.0 = Release|Any CPU
+ {025632E8-CB51-4E49-B47C-B9C75D35A874}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {025632E8-CB51-4E49-B47C-B9C75D35A874}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {025632E8-CB51-4E49-B47C-B9C75D35A874}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {025632E8-CB51-4E49-B47C-B9C75D35A874}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
diff --git a/SimpleBlazorMultiselectDemo/Components/App.razor b/SimpleBlazorMultiselectDemo/Components/App.razor
deleted file mode 100644
index 5501298..0000000
--- a/SimpleBlazorMultiselectDemo/Components/App.razor
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SimpleBlazorMultiselectDemo/Components/Pages/Error.razor b/SimpleBlazorMultiselectDemo/Components/Pages/Error.razor
deleted file mode 100644
index 30c1b33..0000000
--- a/SimpleBlazorMultiselectDemo/Components/Pages/Error.razor
+++ /dev/null
@@ -1,38 +0,0 @@
-@page "/Error"
-@using System.Diagnostics
-
-Error
-
-
Error.
-
An error occurred while processing your request.
-
-@if (ShowRequestId)
-{
-
- Request ID:@RequestId
-
-}
-
-
Development Mode
-
- Swapping to Development environment will display more detailed information about the error that occurred.
-
-
- The Development environment shouldn't be enabled for deployed applications.
- It can result in displaying sensitive information from exceptions to end users.
- For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
- and restarting the app.
-
+
+
+
\ No newline at end of file
diff --git a/SimpleBlazorMultiselectDemo/Components/Layout/MainLayout.razor b/src/SimpleBlazorMultiselect.Demo/Layout/MainLayout.razor
similarity index 100%
rename from SimpleBlazorMultiselectDemo/Components/Layout/MainLayout.razor
rename to src/SimpleBlazorMultiselect.Demo/Layout/MainLayout.razor
diff --git a/SimpleBlazorMultiselectDemo/Components/Layout/MainLayout.razor.css b/src/SimpleBlazorMultiselect.Demo/Layout/MainLayout.razor.css
similarity index 100%
rename from SimpleBlazorMultiselectDemo/Components/Layout/MainLayout.razor.css
rename to src/SimpleBlazorMultiselect.Demo/Layout/MainLayout.razor.css
diff --git a/SimpleBlazorMultiselectDemo/Components/Layout/NavMenu.razor b/src/SimpleBlazorMultiselect.Demo/Layout/NavMenu.razor
similarity index 58%
rename from SimpleBlazorMultiselectDemo/Components/Layout/NavMenu.razor
rename to src/SimpleBlazorMultiselect.Demo/Layout/NavMenu.razor
index f1dcebe..19f02f0 100644
--- a/SimpleBlazorMultiselectDemo/Components/Layout/NavMenu.razor
+++ b/src/SimpleBlazorMultiselect.Demo/Layout/NavMenu.razor
@@ -40,7 +40,34 @@
CustomTemplate
+
+
+
+
+
+ Big list with Virtualize
+
+
+
+
+
+
+ Big list without Virtualize
+
+
+
+
+
+
+ CustomStyling
+
+
+
+
+
+
+ MultipleDropdowns
+
-
\ No newline at end of file
diff --git a/SimpleBlazorMultiselectDemo/Components/Layout/NavMenu.razor.css b/src/SimpleBlazorMultiselect.Demo/Layout/NavMenu.razor.css
similarity index 100%
rename from SimpleBlazorMultiselectDemo/Components/Layout/NavMenu.razor.css
rename to src/SimpleBlazorMultiselect.Demo/Layout/NavMenu.razor.css
diff --git a/SimpleBlazorMultiselectDemo/Models/SimpleItem.cs b/src/SimpleBlazorMultiselect.Demo/Models/SimpleItem.cs
similarity index 100%
rename from SimpleBlazorMultiselectDemo/Models/SimpleItem.cs
rename to src/SimpleBlazorMultiselect.Demo/Models/SimpleItem.cs
diff --git a/SimpleBlazorMultiselectDemo/Components/Pages/BasicDropdown.razor b/src/SimpleBlazorMultiselect.Demo/Pages/BasicDropdown.razor
similarity index 100%
rename from SimpleBlazorMultiselectDemo/Components/Pages/BasicDropdown.razor
rename to src/SimpleBlazorMultiselect.Demo/Pages/BasicDropdown.razor
diff --git a/src/SimpleBlazorMultiselect.Demo/Pages/BigListNoVirtualize.razor b/src/SimpleBlazorMultiselect.Demo/Pages/BigListNoVirtualize.razor
new file mode 100644
index 0000000..8ba5679
--- /dev/null
+++ b/src/SimpleBlazorMultiselect.Demo/Pages/BigListNoVirtualize.razor
@@ -0,0 +1,26 @@
+@page "/BigListNoVirtualize"
+
Big list without virtualize
+
+
+
+
+
+ You have selected the following items:
+
+ @foreach (var item in _selectedItems)
+ {
+
@item
+ }
+
+
+
+
+
+@code {
+ private readonly List _items = Enumerable.Range(1, 100_000).Select(i => $"Item {i}").ToList();
+ private List _selectedItems = new();
+
+}
\ No newline at end of file
diff --git a/src/SimpleBlazorMultiselect.Demo/Pages/BigListVirtualize.razor b/src/SimpleBlazorMultiselect.Demo/Pages/BigListVirtualize.razor
new file mode 100644
index 0000000..9ce4ffd
--- /dev/null
+++ b/src/SimpleBlazorMultiselect.Demo/Pages/BigListVirtualize.razor
@@ -0,0 +1,27 @@
+@page "/BigListVirtualize"
+
Big list with virtualize
+
+
+
+
+
+ You have selected the following items:
+
+ @foreach (var item in _selectedItems)
+ {
+
@item
+ }
+
+
+
+
+
+@code {
+ private readonly List _items = Enumerable.Range(1, 100_000).Select(i => $"Item {i}").ToList();
+ private List _selectedItems = new();
+
+}
\ No newline at end of file
diff --git a/src/SimpleBlazorMultiselect.Demo/Pages/CustomStyling.razor b/src/SimpleBlazorMultiselect.Demo/Pages/CustomStyling.razor
new file mode 100644
index 0000000..24d5963
--- /dev/null
+++ b/src/SimpleBlazorMultiselect.Demo/Pages/CustomStyling.razor
@@ -0,0 +1,24 @@
+@page "/CustomStyling"
+
CustomStyling
+
+
+
+
+
+
+ You have selected the following items:
+
+ @foreach (var item in _selectedItems)
+ {
+
@item
+ }
+
+
+
+
+@code {
+ private readonly List _items = new() { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9", "Item 10" };
+ private List _selectedItems = new();
+}
\ No newline at end of file
diff --git a/src/SimpleBlazorMultiselect.Demo/Pages/CustomStyling.razor.css b/src/SimpleBlazorMultiselect.Demo/Pages/CustomStyling.razor.css
new file mode 100644
index 0000000..a3818f9
--- /dev/null
+++ b/src/SimpleBlazorMultiselect.Demo/Pages/CustomStyling.razor.css
@@ -0,0 +1,54 @@
+::deep .simple-dropdown .btn-outline-secondary {
+ --bs-btn-color: red;
+ --bs-btn-bg: black;
+ --bs-btn-border-color: green;
+ --bs-btn-border-width: 10px;
+
+ animation: rainbow 2.5s linear;
+ animation-iteration-count: infinite;
+}
+
+::deep .simple-dropdown .dropdown-item {
+ --bs-btn-color: red;
+ --bs-dropdown-link-hover-bg: yellow;
+}
+
+
+@keyframes rainbow{
+ 100%,0%{
+ --bs-btn-color: rgb(255,0,0);
+ }
+ 8%{
+ --bs-btn-color: rgb(255,127,0);
+ }
+ 16%{
+ --bs-btn-color: rgb(255,255,0);
+ }
+ 25%{
+ --bs-btn-color: rgb(127,255,0);
+ }
+ 33%{
+ --bs-btn-color: rgb(0,255,0);
+ }
+ 41%{
+ --bs-btn-color: rgb(0,255,127);
+ }
+ 50%{
+ --bs-btn-color: rgb(0,255,255);
+ }
+ 58%{
+ --bs-btn-color: rgb(0,127,255);
+ }
+ 66%{
+ --bs-btn-color: rgb(0,0,255);
+ }
+ 75%{
+ --bs-btn-color: rgb(127,0,255);
+ }
+ 83%{
+ --bs-btn-color: rgb(255,0,255);
+ }
+ 91%{
+ --bs-btn-color: rgb(255,0,127);
+ }
+}
\ No newline at end of file
diff --git a/SimpleBlazorMultiselectDemo/Components/Pages/CustomTemplate.razor b/src/SimpleBlazorMultiselect.Demo/Pages/CustomTemplate.razor
similarity index 97%
rename from SimpleBlazorMultiselectDemo/Components/Pages/CustomTemplate.razor
rename to src/SimpleBlazorMultiselect.Demo/Pages/CustomTemplate.razor
index dd12cbc..70993a7 100644
--- a/SimpleBlazorMultiselectDemo/Components/Pages/CustomTemplate.razor
+++ b/src/SimpleBlazorMultiselect.Demo/Pages/CustomTemplate.razor
@@ -13,7 +13,7 @@ Click on a selected item to remove it from the selection.
@foreach (var item in options)
{
_selectedItems.Remove(item)"
style="padding: 6px; margin-right: 10px;">
@item
diff --git a/SimpleBlazorMultiselectDemo/Components/Pages/FilteredDropdown.razor b/src/SimpleBlazorMultiselect.Demo/Pages/FilteredDropdown.razor
similarity index 100%
rename from SimpleBlazorMultiselectDemo/Components/Pages/FilteredDropdown.razor
rename to src/SimpleBlazorMultiselect.Demo/Pages/FilteredDropdown.razor
diff --git a/SimpleBlazorMultiselectDemo/Components/Pages/Home.razor b/src/SimpleBlazorMultiselect.Demo/Pages/Home.razor
similarity index 100%
rename from SimpleBlazorMultiselectDemo/Components/Pages/Home.razor
rename to src/SimpleBlazorMultiselect.Demo/Pages/Home.razor
diff --git a/src/SimpleBlazorMultiselect.Demo/Pages/MultipleDropdowns.razor b/src/SimpleBlazorMultiselect.Demo/Pages/MultipleDropdowns.razor
new file mode 100644
index 0000000..71421bc
--- /dev/null
+++ b/src/SimpleBlazorMultiselect.Demo/Pages/MultipleDropdowns.razor
@@ -0,0 +1,16 @@
+@page "/MultipleDropdowns"
+