BlazorColorPicker 4.1.1
dotnet add package BlazorColorPicker --version 4.1.1
NuGet\Install-Package BlazorColorPicker -Version 4.1.1
<PackageReference Include="BlazorColorPicker" Version="4.1.1" />
<PackageVersion Include="BlazorColorPicker" Version="4.1.1" />
<PackageReference Include="BlazorColorPicker" />
paket add BlazorColorPicker --version 4.1.1
#r "nuget: BlazorColorPicker, 4.1.1"
#:package BlazorColorPicker@4.1.1
#addin nuget:?package=BlazorColorPicker&version=4.1.1
#tool nuget:?package=BlazorColorPicker&version=4.1.1
Blazor-Color-Picker
Sometimes HTML5 colorpicker doesn't suit me for an application. I prefer to offer the user a predefined color palette
DEMO : https://tossnet.github.io/Blazor-Color-Picker/
Opens a palette with the Material colors
Installation
The implementation has been improved: version 4.0 uses a service declared via dependency injection
To Install
Install-Package BlazorColorPicker
or
dotnet add package BlazorColorPicker
For client-side and server-side Blazor - add script section to index.html or _Host.cshtml (head section)
<link href="_content/BlazorColorPicker/colorpicker.css" rel="stylesheet" />
In program.cs, declare
builder.Services.AddColorPicker();
ColorPicker are rendered by the <BlazorColorPicker.ColorPicker />. This component needs to be added to the main layout of your application/site. You typically do this in the MainLayout.razor file at the end of the <main> section.
Usage
@page "/"
@using BlazorColorPicker
@inject IColorPickerService ColorPickerService
<button class="btn btn-primary" @onclick="OpenModal">
<div style="background-color:@color" class="buttonColor"></div> Select a Color
</button>
@code {
private string color = "#F1F7E9";
private async Task OpenModal()
{
var parameters = new ColorPickerParameters
{
ColorSelected = color,
};
color = await ColorPickerService.ShowColorPicker(parameters);
}
}
<a name="ReleaseNotes"></a>Release Notes
<details open="open"><summary>Version 4.1.1</summary>
- Performance & memory optimization: default colors are now static and shared across all instances
- Fixed memory leak in OnParametersSet() that caused unbounded list growth
- Zero allocations when using default color palette </details>
<details><summary>Version 4.0.2</summary>
- Added AddColorPicker() to simplify declaration </details>
<details><summary>Version 4.0.1</summary>
- increase the z-index to 9999 </details>
<details><summary>Version 4.0.0</summary>
- the implementation has been improved: version 4.0 uses a service declared via dependency injection </details>
⚠️ Breaking changes ⚠️
<details><summary>Version 3.1.0</summary>
- you can customise the size of the palette using your CSS styles
- A red colour of the first column was not correct
- Re-addition of .NET7 compatibility </details>
<details><summary>Version 2.2.0</summary>
- Remove the internal use of IJSRuntime </details>
<details><summary>Version 2.1.0</summary>
- no need to declare the _content/BlazorColorPicker/colorpicker.js file </details>
| 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 is compatible. 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. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.Components.Web (>= 10.0.2)
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.23)
-
net9.0
- Microsoft.AspNetCore.Components.Web (>= 9.0.12)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on BlazorColorPicker:
| Package | Downloads |
|---|---|
|
PrototyperThemeRCL
Do not use yet. A Razor Class Library that provides user built themes to attach to pages and components. Themes are divided into 'Sets' and a set is applied to a page or component. No knowledge of CSS is required to set up a Theme. |
|
|
PrototyperMenuRCL
Do not try to use this yet. A Razor Class Library that provides data driven menus. The current version only allows very graphical menu buttons. Menu 'Sets' contain menu 'Rows' which in turn contain 'buttons'. Clicking on a button can (1) go to another menu set (2) go to a page in the host app (3) load a component from the host or the RCL. Provides easy maintence of the data and easy to implement. |
|
|
KristofferStrube.Blazor.SVGEditor
A SVG Editor that is implemented in and for Blazor. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on BlazorColorPicker:
| Repository | Stars |
|---|---|
|
KristofferStrube/Blazor.SVGEditor
A basic SVG editor written in Blazor.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 4.1.1 | 26 | 1/17/2026 |
| 4.1.0 | 95 | 1/14/2026 |
| 4.0.2 | 5,480 | 3/16/2025 |
| 4.0.1 | 255 | 3/15/2025 |
| 4.0.0 | 304 | 3/15/2025 |
| 3.1.2 | 6,781 | 11/15/2024 |
| 3.1.1 | 13,677 | 3/31/2024 |
| 3.1.0 | 523 | 3/30/2024 |
| 3.0.0 | 1,915 | 1/26/2024 |
| 2.3.1 | 4,680 | 11/15/2023 |
| 2.3.0 | 15,199 | 12/2/2022 |
| 2.2.0 | 5,069 | 10/22/2022 |
| 2.1.0 | 37,660 | 4/4/2022 |
| 2.0.1 | 1,692 | 2/16/2022 |
| 2.0.0 | 4,599 | 12/16/2021 |
| 1.2.1 | 17,844 | 6/15/2021 |
| 1.2.0 | 839 | 5/17/2021 |
| 1.1.2 | 9,307 | 1/16/2021 |
| 1.1.1 | 7,635 | 11/1/2020 |
| 1.1.0 | 1,878 | 10/14/2020 |
| 1.0.9 | 1,931 | 5/27/2020 |
| 1.0.8 | 719 | 5/26/2020 |
| 1.0.7 | 970 | 5/25/2020 |
| 1.0.6 | 717 | 5/25/2020 |
| 1.0.5 | 672 | 5/25/2020 |
| 1.0.2 | 674 | 5/25/2020 |
| 1.0.1 | 662 | 5/25/2020 |
Add .NET 10 support, remove .NET 7