DineshKumar.UIRenderer.Blazor
1.0.0
dotnet add package DineshKumar.UIRenderer.Blazor --version 1.0.0
NuGet\Install-Package DineshKumar.UIRenderer.Blazor -Version 1.0.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="DineshKumar.UIRenderer.Blazor" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DineshKumar.UIRenderer.Blazor" Version="1.0.0" />
<PackageReference Include="DineshKumar.UIRenderer.Blazor" />
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 DineshKumar.UIRenderer.Blazor --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DineshKumar.UIRenderer.Blazor, 1.0.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 DineshKumar.UIRenderer.Blazor@1.0.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=DineshKumar.UIRenderer.Blazor&version=1.0.0
#tool nuget:?package=DineshKumar.UIRenderer.Blazor&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DineshKumar.UIRenderer.Blazor
Blazor adapter for the schema-driven Universal UI Renderer.
Pass ONE JSON schema — get a complete, production-ready Blazor component.
Install
dotnet add package DineshKumar.UIRenderer.Blazor
Setup
Add to _Imports.razor:
@using DineshKumar.UIRenderer.Blazor.Components
@using DineshKumar.UIRenderer.Blazor.Schema
@using DineshKumar.UIRenderer.Blazor.State
Add to wwwroot/index.html (Blazor WASM) or _Host.cshtml (Blazor Server):
<link rel="stylesheet" href="_content/DineshKumar.UIRenderer.Blazor/uir.css" />
Usage
From a typed C# object
<UIRenderer Schema="@_schema" OnSubmit="HandleSubmit" />
@code {
private readonly FormSchema _schema = new()
{
Id = "contact",
Version = "1.0.0",
Title = "Contact Us",
Columns = 2,
Fields =
[
new() { Id = "name", Type = "text", Label = "Name", Required = true },
new() { Id = "email", Type = "email", Label = "Email", Required = true,
Validation = [new() { Type = "email" }] },
new() { Id = "message", Type = "textarea", Label = "Message", ColSpan = 2 },
],
};
private async Task HandleSubmit(FormStateSnapshot snapshot)
{
// snapshot.Values → Dictionary<string, object?>
// snapshot.Valid → bool
// snapshot.Touched → HashSet<string>
await MyApi.PostAsync("/contact", snapshot.Values);
}
}
From a JSON string
<UIRenderer SchemaJson="@_json" OnSubmit="HandleSubmit" />
@code {
private string _json = """
{
"id": "contact", "version": "1.0.0", "type": "form",
"title": "Contact Us",
"fields": [
{ "id": "name", "type": "text", "label": "Name", "required": true },
{ "id": "email", "type": "email", "label": "Email", "required": true }
]
}
""";
}
Parameters
| Parameter | Type | Description |
|---|---|---|
Schema |
UISchema? |
Typed schema object |
SchemaJson |
string? |
Raw JSON string (parsed at render time) |
InitialValues |
Dictionary<string, object?>? |
Pre-fill form / detail fields |
Data |
List<Dictionary<string, object?>>? |
Row data for table / list |
OnSubmit |
EventCallback<FormStateSnapshot> |
Form / wizard submit |
OnCancel |
EventCallback |
Cancel button callback |
OnSelectionChange |
EventCallback<List<string>> |
Table row selection |
OnItemClick |
EventCallback<Dictionary<string, object?>> |
List item click |
OnDetailAction |
EventCallback<string> |
Detail view action button |
Registry |
UIPluginRegistry? |
Custom plugin registry (default: singleton) |
Schema types
@* Form *@
<UIRenderer Schema="@formSchema" OnSubmit="HandleSubmit" />
@* Table *@
<UIRenderer Schema="@tableSchema" Data="@rows" OnSelectionChange="HandleSelection" />
@* Dashboard *@
<UIRenderer Schema="@dashSchema" />
@* Wizard *@
<UIRenderer Schema="@wizardSchema" OnSubmit="HandleSubmit" />
@* Detail (read-only) *@
<UIRenderer Schema="@detailSchema" InitialValues="@record" OnDetailAction="HandleAction" />
@* List *@
<UIRenderer Schema="@listSchema" Data="@items" OnItemClick="HandleClick" />
Plugin registration
// Program.cs or startup
UIRenderer.Register<SignaturePadComponent>("signature-pad");
UIRenderer.Register<RichTextEditorComponent>("rich-text-editor");
// Or on the default singleton registry directly:
UIPluginRegistry.Default.Register("signature-pad", typeof(SignaturePadComponent));
Custom plugin components must accept these parameters:
@* MyPluginComponent.razor *@
@code {
[Parameter] public FieldSchema Field { get; set; } = default!;
[Parameter] public object? Value { get; set; }
[Parameter] public EventCallback<object?> OnChange { get; set; }
[Parameter] public EventCallback OnBlur { get; set; }
[Parameter] public bool HasError { get; set; }
}
Services
Use services directly for server-side logic:
using DineshKumar.UIRenderer.Blazor.State;
// Validate fields
var errors = ValidationService.ValidateField(field, value);
var result = ValidationService.ValidateForm(fields, values, visibleIds);
// Evaluate conditions
bool visible = ConditionalService.IsFieldVisible(field, values);
var visibleIds = ConditionalService.GetVisibleFieldIds(fields, values);
// Observable form state (inject as scoped service)
var state = new FormStateService();
state.Init(fields, initialValues);
state.Changed += StateHasChanged;
state.SetValue("email", "user@example.com");
var snapshot = state.Snapshot();
Links
License
MIT © Dinesh Kumar Sridharan
| 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 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.
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.0)
- System.Text.Json (>= 8.0.5)
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 |
|---|---|---|
| 1.0.0 | 44 | 5/28/2026 |