FormKit.Abstractions 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FormKit.Abstractions --version 1.0.0
                    
NuGet\Install-Package FormKit.Abstractions -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="FormKit.Abstractions" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FormKit.Abstractions" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="FormKit.Abstractions" />
                    
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 FormKit.Abstractions --version 1.0.0
                    
#r "nuget: FormKit.Abstractions, 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 FormKit.Abstractions@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=FormKit.Abstractions&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=FormKit.Abstractions&version=1.0.0
                    
Install as a Cake Tool

FormKit

A lightweight, fluent form builder for Blazor that generates accessible EditForm markup, validation wiring, and field components from a strongly-typed model. Renderer-agnostic: the same fluent definition works with plain HTML, MudBlazor, or FluentUI via swappable renderers.

Quickstart

1. Install

dotnet add package FormKit
dotnet add package FormKit.Renderers.Html

2. Register services

builder.Services.AddFormKit()
    .UseHtmlRenderer();

3. Define and render a form

@page "/customers/new"
@using FormKit

<FormKitForm TModel="CustomerVm"
             Definition="@_form"
             Model="@_model"
             OnValidSubmit="HandleSubmit" />

@code {
    private CustomerVm _model = new();

    private readonly FormDefinition<CustomerVm> _form = FormBuilder.For<CustomerVm>()
        .Field(x => x.Name).Required().MaxLength(120)
        .Field(x => x.Email).Required()
        .Field(x => x.IsCompany).Label("Is a company")
        .Field(x => x.CompanyName)
            .When(m => m.IsCompany)
            .Required()
        .Group("Address", g => g
            .Field(x => x.Address.Street).Required()
            .Field(x => x.Address.City).Required()
            .Field(x => x.Address.Country).Select<Country>())
        .Build();

    private Task HandleSubmit(EditContext context) => _service.CreateAsync(_model);
}

Features

  • Fluent API — describe forms from POCO models in a few lines
  • Accessible by default — correct label/for association, aria-required, aria-invalid, aria-describedby, role="alert" error regions
  • Conditional fields.When(m => m.IsCompany) shows/hides fields based on model state
  • Multi-step forms.Step("Customer", ...) with per-step validation
  • Field groups.Group("Address", ...) renders as <fieldset> with <legend>
  • DataAnnotations validation — built-in via EditForm and DataAnnotationsValidator
  • Pluggable renderers — swap UI libraries without rewriting form definitions
  • Trimming & AOT friendly — annotated with IsTrimmable=true

Supported Field Types

Type Auto-detected from HTML input
Text string <input type="text">
Number int, long, short, byte <input type="number">
Decimal decimal, double, float <input type="number" step="any">
Checkbox bool <input type="checkbox">
Date DateOnly <input type="date">
DateTime DateTime, DateTimeOffset <input type="datetime-local">
Time TimeOnly, TimeSpan <input type="time">
Select via .Select<T>() <select>
MultilineText via .Type(FieldType.MultilineText) <textarea>
Hidden via .Type(FieldType.Hidden) <input type="hidden">

Architecture

Package Purpose
FormKit.Abstractions Interfaces (IFormRenderer, IFieldDescriptor, IValidationAdapter)
FormKit Fluent builder, validation orchestration, FormKitForm component
FormKit.Renderers.Html Plain HTML renderer (zero-dependency, accessible)

License

MIT

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

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FormKit.Abstractions:

Package Downloads
FormKit

Fluent form builder for Blazor — define forms from POCO models with pluggable renderers and validation.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.7.0 55 5/30/2026
1.6.0 51 5/30/2026
1.5.0 60 5/30/2026
1.4.0 55 5/30/2026
1.3.0 53 5/30/2026
1.2.0 60 5/30/2026
1.1.0 55 5/30/2026
1.0.0 52 5/30/2026