PureBlazor.Components
0.32.8
Prefix Reserved
See the version list below for details.
dotnet add package PureBlazor.Components --version 0.32.8
NuGet\Install-Package PureBlazor.Components -Version 0.32.8
<PackageReference Include="PureBlazor.Components" Version="0.32.8" />
paket add PureBlazor.Components --version 0.32.8
#r "nuget: PureBlazor.Components, 0.32.8"
// Install PureBlazor.Components as a Cake Addin #addin nuget:?package=PureBlazor.Components&version=0.32.8 // Install PureBlazor.Components as a Cake Tool #tool nuget:?package=PureBlazor.Components&version=0.32.8
PureBlazor Components
[!NOTE] This component library is pre-release software.
These components are native Blazor UI components that are free to use for any Blazor project. The components also work seamlessly with PureBlazor CMS.
Features
- Native Blazor - The components are built for Blazor. They are not a wrapper around a JavaScript library.
- Blazing Fast - The components are fast on every platform.
- Headless Mode - The components have a fully customizable UI. You may disable all styles with a single property.
- Tailwind Compatible - The components have built-in styles that automatically merge with your Tailwind classes.
[!NOTE] This documentation is incomplete. We have not documented all components yet.
Please, feel free to ask questions in our Discord server, open an issue, or create a pull request.
Getting started
Installation
InteractiveWebAssembly / SSR
Install the PureBlazor.Components
NuGet package to your Client project.
dotnet add package PureBlazor.Components
Register the components and services to your Program.cs
file.
builder.AddPureBlazorComponents();
InteractiveServer / InteractiveAuto
You'll need to add the ASP.NET Core integration package to your Server project and update your Program.cs
file, in
addition to the Client Project.
dotnet add package PureBlazor.Components.AspNetCore
Theming
We have designed PureBlazor's components to be compatible with Tailwind CSS so you can customize with Tailwind or any custom CSS.
In the future, we will offer additional extensibility points to customize the components with C#. We will publish documentation on this as we solidify it further.
Use the default styles
Include pureblazor.css
in your App.Razor
file, in the <head>
tag.
<link rel="stylesheet" href="_content/PureBlazor.Components/pureblazor.css" />
To customize further on top of these default styles with Tailwind CSS, see tailwind.md.
Ad-hoc customization
All components have a Styles
parameter that accepts a string
of CSS classes. If you use Tailwind, the classes
will merge with the default styles. The Styles
parameter is parsed and evaluated for conflicts; conflicting styles
passed in here will supersede default classes.
For example, to change the shade of red for the Danger
accent, which is bg-red-900
by default:
<PureButton Accent="Accent.Danger" Styles="bg-red-600">Default button</PureButton>
C# customization
You can override the default theme in C# by creating a PureStyles
object and passing it to a CascadingValue
.
The PureStyles
object has properties for each component style.
<CascadingValue Value="styles">
<PureButton Accent="Accent.Danger">Default button</PureButton>
</CascadingValue>
@code {
PureStyles styles = new();
}
[!IMPORTANT] Not all components have C# customization available yet.
Headless Mode
Headless mode turns the UI components into completely unstyled, fully customizable, and accessible components.
You can enable headless mode by setting the Theme
property to Off
using a CascadingValue
. You may do so for individual
components or wrap your entire application in a CascadingValue
.
<CascadingValue Value="Theme.Off">
<PureButton>Unstyled button</PureButton>
</CascadingValue>
FAQ
Why not use another xx
library?
- We have built these components to work seamlessly with the PureBlazor CMS. In addition, please, review our Features section to understand our broader goals.
Is this library free to use?
- Yes! This library is free to use for any Blazor project.
Can I use this library with .NET MAUI Blazor projects?
- This library should work with .NET MAUI, but we have not tested it yet. Please, let us know if you encounter any issues.
Can I use this library with Blazor WebAssembly / Blazor Server / InteractiveAuto?
- Yes! This library supports all Blazor hosting models.
Is this library production-ready?
- No. This library is pre-release software still in development.
Do you accept contributions?
- Yes! We accept contributions. Please see the CONTRIBUTING.md file for more information.
How do I report a bug?
- Please, open an issue on the GitHub repository.
- Please, include as much information as possible, including what library version and browser you are using, and any steps to reproduce the issue.
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. |
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.8)
- Microsoft.AspNetCore.Components.WebAssembly (>= 8.0.8)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- PureBlazor.Components.Icons (>= 0.32.8)
- PureBlazor.Components.Primitives (>= 0.32.0)
- System.Text.Json (>= 8.0.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on PureBlazor.Components:
Package | Downloads |
---|---|
PureBlazor.Components.AspNetCore
ASP.NET Core integration package for PureBlazor UI components. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.40.0-rc2 | 28 | 11/2/2024 |
0.32.8 | 91 | 9/20/2024 |
0.32.0 | 115 | 9/18/2024 |
0.31.0 | 155 | 5/30/2024 |
0.30.0 | 117 | 5/25/2024 |
0.27.0 | 126 | 5/6/2024 |
0.26.0 | 119 | 5/5/2024 |
0.25.0 | 167 | 5/5/2024 |
0.24.0 | 109 | 5/5/2024 |
0.23.0 | 107 | 5/4/2024 |
0.22.0 | 99 | 5/3/2024 |
0.19.0 | 119 | 4/29/2024 |
0.18.0 | 201 | 4/26/2024 |
0.17.0 | 108 | 4/26/2024 |
0.16.0 | 113 | 4/26/2024 |
0.15.0 | 119 | 4/26/2024 |
0.14.0 | 120 | 4/26/2024 |
0.13.0 | 127 | 4/26/2024 |
0.12.0 | 119 | 4/26/2024 |
0.11.0 | 114 | 4/26/2024 |
0.10.0-preview1 | 95 | 4/9/2024 |
0.9.2 | 113 | 4/4/2024 |
0.9.1 | 104 | 4/4/2024 |
0.9.0 | 104 | 4/4/2024 |
0.8.0 | 108 | 4/4/2024 |
0.7.0 | 128 | 4/4/2024 |
0.6.0 | 116 | 4/3/2024 |
0.5.0 | 133 | 4/2/2024 |
0.4.0 | 106 | 4/2/2024 |
0.3.0 | 127 | 4/2/2024 |
0.2.0 | 127 | 4/1/2024 |
0.2.0-preview | 92 | 4/26/2024 |
0.1.0 | 118 | 3/21/2024 |
0.1.0-alpha.1 | 98 | 2/2/2024 |
0.0.9 | 117 | 3/21/2024 |
Component Library Updates