CoreBlaze.Components 0.1.0

dotnet add package CoreBlaze.Components --version 0.1.0
                    
NuGet\Install-Package CoreBlaze.Components -Version 0.1.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="CoreBlaze.Components" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CoreBlaze.Components" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="CoreBlaze.Components" />
                    
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 CoreBlaze.Components --version 0.1.0
                    
#r "nuget: CoreBlaze.Components, 0.1.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.
#:package CoreBlaze.Components@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CoreBlaze.Components&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=CoreBlaze.Components&version=0.1.0
                    
Install as a Cake Tool

CoreBlazeKit

A lightweight, extensible, production-ready Blazor component library for .NET 8+
— with a full-featured DataGrid, rich input controls, layout primitives,
display components, and a live interactive demo app.

License: MIT .NET 8


What's inside

Input components

Component Description
TextInput Single-line text; supports text, email, password, url, tel
TextArea Multi-line text with configurable rows and optional MaxLength
NumberInput<T> Generic numeric input — int, decimal, double?, … — with Prefix / Suffix adornments (currency symbols, units, %) and DecimalPlaces rounding
DatePicker Native HTML5 date picker bound to DateTime?, with MinDate / MaxDate
Dropdown<TItem, TValue> Single-select generic dropdown
MultiSelectDropdown<TItem, TValue> Popup multi-select with chip or text-summary display modes, Select-all toolbar
FileUpload Drag-and-drop or click to browse; binds to IReadOnlyList<IBrowserFile>

All inputs share a BaseInputComponent<T> base that wires EditContext, FieldIdentifier, two-way @bind-Value, validation messages, label, placeholder, disabled, required, and OnChange / OnBlur / OnFocus events.


DataGrid DataGrid<T>

Feature Details
Sorting Click header to sort asc/desc; Shift-click for multi-column sort with numbered ordinal badges
Filtering Per-column filter row + global search box
Paging Pager with configurable page-size selector
Edit modes Row mode and Cell (double-click) mode; Enter to save, Esc to cancel
CRUD Add / Edit / Delete / Save / Cancel with row-state tracking (Added / Modified / Deleted)
Selection Off / Single / Multiple (checkbox column + @bind-SelectedItems)
Column templates Template (display) + EditTemplate + HeaderTemplate per column
Column visibility ⛁ Columns dropdown in toolbar to show/hide columns
Export ⇩ Export dropdown with CSV, real Excel (.xlsx) via ClosedXML, and real PDF via QuestPDF

Shared / Layout components

Component Description
Modal Dialog with blurred backdrop, @bind-IsOpen, Title, ChildContent, Footer, ModalSize presets
Toaster + ToastService Non-blocking notifications (Info / Success / Warning / Error), auto-dismiss, sticky mode
Spinner Four variants: Ring, Pulse (radar), Wave (breathing), Gradient (conic); custom colours, centre image/icon, LoadingOverlay wrapper
Tabs + Tab Tab strip with icon support, @bind-ActiveTitle, disabled tabs, slide-in animation
Divider Horizontal/vertical separator with optional centre label
Stack Flex container with Direction, Gap (0–6), Align, Justify, Wrap

Display components

Component Description
Badge Pill label (text, count, dot); anchors to any wrapped child
ProgressBar Labelled progress bar with variants, striped, and indeterminate modes
Alert Inline contextual banner (stays in document flow); four variants, dismissible
Toggle iOS-style switch with three sizes, @bind-Value, track text
Avatar User avatar — photo or auto-coloured initials derived from name; badge overlay slot

Architecture

CoreBlaze.sln
├── src/
│   ├── CoreBlaze.Components/      # Razor Class Library (NuGet-ready)
│   │   ├── Base/                  # BaseInputComponent<T>
│   │   ├── Components/
│   │   │   ├── Inputs/            # 7 input controls
│   │   │   ├── Grid/              # DataGrid + GridColumn + GridPager
│   │   │   └── Shared/            # Modal, Toast, Spinner, Tabs, Stack, Divider,
│   │   │                          # Badge, ProgressBar, Alert, Toggle, Avatar
│   │   ├── Models/                # RowState, SortDescriptor, Toast, …
│   │   ├── Services/              # ThemeService, ToastService, ValidationService
│   │   ├── Utilities/             # CssBuilder, PropertyAccessor (compiled getters)
│   │   └── wwwroot/               # coreblaze.css (global CSS vars) · coreblaze.js
│   │
│   └── CoreBlaze.Demo/            # Blazor Web App — Interactive Server
│       ├── Components/
│       │   ├── Layout/            # MainLayout (sidebar + topbar + ThemeService toggle)
│       │   └── Pages/
│       │       ├── Inputs/        # /inputs  /inputs/text  /textarea  /number
│       │       │                  # /date  /dropdown  /multiselect  /fileupload
│       │       ├── GridDemo       # /grid
│       │       ├── DisplayDemo    # /display  (Badge / Progress / Alert / Toggle / Avatar)
│       │       ├── FeedbackDemo   # /feedback  (Toasts + Modal)
│       │       ├── SpinnerDemo    # /layout/spinner
│       │       ├── TabsDemo       # /layout/tabs
│       │       ├── StandardLayout # /layout/standard
│       │       ├── CustomLayouts  # /layout/custom  (Centered / Split / Dashboard / Master-detail)
│       │       └── FormDemo       # /form  (EditForm + DataAnnotations)
│       └── wwwroot/
│
└── tests/
    └── CoreBlaze.Components.Tests/ # xUnit + bUnit (36 tests)

Prerequisites


Get started

# Clone
git clone https://github.com/meruvakirankumar/CoreBlazeKit.git
cd CoreBlazeKit

# Restore, build, run demo
dotnet restore
dotnet build
dotnet run --project src/CoreBlaze.Demo

The demo starts on http://localhost:5141 (or the URL shown in the terminal).
Browse the sidebar — every component has a dedicated page with an interactive playground, variants, live bound values, and a copyable code snippet.


Using the library in your own project

1. Reference the project (or install the NuGet package)


<ProjectReference Include="path/to/CoreBlaze.Components/CoreBlaze.Components.csproj" />

2. Register services in Program.cs

builder.Services.AddCoreBlaze(); // registers ThemeService, ToastService, ValidationService
<link rel="stylesheet" href="_content/CoreBlaze.Components/coreblaze.css" />

<script src="_content/CoreBlaze.Components/coreblaze.js"></script>

4. Add the Toaster to your layout (once)

<Toaster Position="ToastPosition.TopRight" />

5. Add global @using to _Imports.razor

@using CoreBlaze.Components.Inputs
@using CoreBlaze.Components.Grid
@using CoreBlaze.Components.Shared
@using CoreBlaze.Components.Services
@using CoreBlaze.Components.Models

Quick examples

<TextInput @bind-Value="_name" Label="Name" Required="true" MaxLength="80" />

<NumberInput TNumber="decimal"
             @bind-Value="_price"
             Label="Unit price"
             Prefix="$"
             Step="0.01"
             DecimalPlaces="2" />

<MultiSelectDropdown TItem="string" TValue="string"
                     Items="_departments"
                     ValueSelector="x => x"
                     TextSelector="x => x"
                     @bind-Value="_selected"
                     DisplayMode="MultiSelectDisplayMode.Chips" />

<DataGrid T="Order"
          Data="_orders"
          EditMode="GridEditMode.Row"
          SelectionMode="GridSelectionMode.Multiple"
          @bind-SelectedItems="_selectedOrders"
          EnableGlobalSearch="true"
          ExportFormats="GridExportFormat.All"
          ExportFileName="orders">
    <Columns>
        <GridColumn T="Order" Field="Id"   Title="ID" Editable="false" />
        <GridColumn T="Order" Field="Name" Title="Customer" />
    </Columns>
</DataGrid>

<Spinner Variant="SpinnerVariant.Pulse"
         Size="SpinnerSize.Large"
         Colors="@(new[] { "#4f46e5", "#a855f7", "#ec4899" })"
         CenterIcon="🔄" />

<Alert Variant="AlertVariant.Success" Title="Saved" Dismissible="true">
    Your changes were persisted successfully.
</Alert>

<Toggle @bind-Value="_notifications" Label="Push notifications" />

<Avatar Name="Alice Anderson" Size="AvatarSize.Large">
    <span class="cb-avatar-dot"></span>
</Avatar>

Dark mode

Add class="cb-theme-dark" to any ancestor element (typically the layout root):

<div class="@(isDark ? "cb-theme-dark" : null)">
    ...
</div>

Use ThemeService to toggle it from anywhere:

@inject ThemeService Theme

void ToggleTheme() => Theme.SetTheme(isDark ? "light" : "dark");

Theming (CSS variables)

All colours, radii, shadows, and fonts are exposed as CSS custom properties:

/* Light (default) */
:root {
    --cb-primary:      #4f46e5;   /* indigo */
    --cb-danger:       #dc2626;
    --cb-success:      #16a34a;
    --cb-warning:      #f59e0b;
    --cb-surface:      #ffffff;
    --cb-border:       #e5e7eb;
    --cb-text:         #1f2937;
    --cb-text-muted:   #64748b;
    --cb-radius:       0.5rem;
    --cb-font:         'Inter', system-ui, sans-serif;
}

/* Override anything globally */
:root {
    --cb-primary: #7c3aed;   /* switch to violet */
}

Running tests

dotnet test tests/CoreBlaze.Components.Tests

36 tests covering CssBuilder, PropertyAccessor, ThemeService, ValidationService, TextInput (bUnit), and DataGrid (bUnit).


Packing as NuGet

dotnet pack src/CoreBlaze.Components -c Release -o ./artifacts

Produces artifacts/CoreBlaze.Components.0.1.0.nupkg + .snupkg (symbols).

To publish:

dotnet nuget push ./artifacts/CoreBlaze.Components.0.1.0.nupkg `
    --api-key <YOUR_KEY> `
    --source https://api.nuget.org/v3/index.json

Bump <Version> in CoreBlaze.Components.csproj before each release.


Repository

GitHub: https://github.com/meruvakirankumar/CoreBlazeKit

git clone https://github.com/meruvakirankumar/CoreBlazeKit.git

License

MIT — see LICENSE for details.

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

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.1.0 111 7/14/2026