NarcRazor 0.5.0
dotnet add package NarcRazor --version 0.5.0
NuGet\Install-Package NarcRazor -Version 0.5.0
<PackageReference Include="NarcRazor" Version="0.5.0" />
<PackageVersion Include="NarcRazor" Version="0.5.0" />
<PackageReference Include="NarcRazor" />
paket add NarcRazor --version 0.5.0
#r "nuget: NarcRazor, 0.5.0"
#:package NarcRazor@0.5.0
#addin nuget:?package=NarcRazor&version=0.5.0
#tool nuget:?package=NarcRazor&version=0.5.0
NarcRazor
NarcRazor is a .NET 9 Razor Class Library providing generic, accessible and themeable Blazor components. It includes actions, forms, layouts, data display, feedback components and typed Chart.js visualizations.
Installation
Install the package from NuGet.org:
dotnet add package NarcRazor
Import the public component namespace:
@using NarcRazor.Components
Load the application’s generated CSS isolation bundle and the global theme in the application host (replace YourApp with the consuming application assembly name):
<link rel="stylesheet" href="YourApp.styles.css" />
<link rel="stylesheet" href="_content/NarcRazor/css/narc-theme.css" />
Blazor templates normally include YourApp.styles.css already; keep that link once. The theme contains the variables, while the generated bundle includes the component styles.
Applications using NarcChart<TItem> must also register the chart services:
using NarcRazor.Extensions;
builder.Services.AddNarcRazorCharts();
Charts require an interactive Blazor render mode. Chart.js is distributed as a local static web asset and does not use a CDN at runtime.
Example
<NarcCard>
<Header>Customer</Header>
<ChildContent>
<NarcBadge Variant="NarcStatusVariant.Success">Active</NarcBadge>
</ChildContent>
<Footer>
<NarcButton>Save</NarcButton>
</Footer>
</NarcCard>
All visual component values are backed by global --narc-* CSS variables. Override variables after loading the provided theme to customize the library.
NarcTable supports opt-in local sorting and pagination. NarcForm accepts either a model or an explicit EditContext, with an optional validation summary and protection against concurrent submissions.
Documentation
- Complete component API reference
- Theme guide
- Chart guide
- Chart presentation and migration
- Navigation between sections
- Searchable multi-selection
- Release guide
- Component conventions
- Package review and roadmap
The demo route /evolution covers URL-driven navigation, searchable multi-selection, responsive bars, donut legends and missing monthly measures.
Development
dotnet restore NarcRazor.slnx
dotnet build NarcRazor.slnx --configuration Release
dotnet test NarcRazor.slnx --configuration Release
Browser acceptance (requires Python Playwright and Chromium):
python3 -m pip install playwright==1.56.0
python3 -m playwright install chromium
dotnet run --project NarcRazor.Demo --urls http://127.0.0.1:5080
# In another terminal:
python3 NarcRazor.Tests/Browser/evolution.py
Set PathBase=/portal on the demo and pass http://127.0.0.1:5080/portal to the browser script to verify hosting under a prefix. Run JavaScript tests with node --test NarcRazor.Tests/JavaScript/*.test.mjs.
Create a local package:
dotnet pack NarcRazor/NarcRazor.csproj --configuration Release --output artifacts -p:PackageVersion=0.1.0
Stable packages are published from GitHub Actions tags through NuGet.org Trusted Publishing. No long-lived NuGet API key is stored in the repository.
License
NarcRazor is licensed under the MIT License. Third-party notices are available under docs/third-party.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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. |
-
net9.0
- Microsoft.AspNetCore.Components.Web (>= 9.0.17)
- pax.BlazorChartJs (>= 0.8.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.