FlintSoft.Components
2.0.19
See the version list below for details.
dotnet add package FlintSoft.Components --version 2.0.19
NuGet\Install-Package FlintSoft.Components -Version 2.0.19
<PackageReference Include="FlintSoft.Components" Version="2.0.19" />
<PackageVersion Include="FlintSoft.Components" Version="2.0.19" />
<PackageReference Include="FlintSoft.Components" />
paket add FlintSoft.Components --version 2.0.19
#r "nuget: FlintSoft.Components, 2.0.19"
#:package FlintSoft.Components@2.0.19
#addin nuget:?package=FlintSoft.Components&version=2.0.19
#tool nuget:?package=FlintSoft.Components&version=2.0.19
FlintSoft.Components v2
A .NET 10 Razor component library with standalone styling, light and dark themes, and no Bootstrap dependency. This is a clean v2 API, not a compatibility layer for v1.
Quick start
Reference the library project or install the FlintSoft.Components NuGet package.
Add @using FlintSoft.Components to your _Imports.razor and register the services:
builder.Services.AddFlintSoftComponents();
Reference the stylesheet in your host document:
<link rel="stylesheet" href="_content/FlintSoft.Components/flintsoft.css" />
Place a single <FsToastHost /> inside your interactive layout. Components support
Interactive Server and WebAssembly. In a Blazor Web App, use an interactive render
mode for pages or routes that contain these components. Prerendering does not call
browser APIs; modal JavaScript loads after interactive rendering.
Run the showcase with:
dotnet run --project Demo
NuGet packaging and publishing
Pushing to main runs .github\workflows\nuget.yml: it restores the pinned
GitVersion tool, runs component tests, builds Release packages, uploads the
.nupkg and .snupkg as a workflow artifact, and publishes to NuGet.org.
Set the repository Actions secret NUGET_API_KEY to a NuGet.org API key
with push permission for FlintSoft.Components.
The workflow uses GitVersion.yml and the full Git history. The package version
is GitVersion's MajorMinorPatch (no prerelease suffix); assembly and
informational versions also come from GitVersion. NuGet.org versions are immutable:
if multiple commits calculate the same MajorMinorPatch, the existing version is
skipped, not replaced. Use version tags (for example 2.0.0) and the repository's
GitVersion conventions to advance versions. No package license is declared yet;
choose an appropriate license before distributing the package publicly.
To create the same packages locally from the repository root:
dotnet tool restore
$version = dotnet gitversion /showvariable MajorMinorPatch
dotnet pack src\FlintSoft.Components.csproj --configuration Release --output artifacts -p:Version=$version -p:PackageVersion=$version
Themes
Set data-fs-theme="light" or data-fs-theme="dark" on an ancestor of the components.
All design tokens start with --fs-. Override them after the library stylesheet:
:root {
--fs-color-primary: #087eaa;
--fs-color-primary-soft: #e8f5fa;
--fs-color-on-primary: #fff;
--fs-radius: .75rem;
--fs-font-family: "Segoe UI", system-ui, sans-serif;
}
Semantic color families include primary, success, danger and warning (each with a
soft variant), plus text, muted, surface, background, border, overlay and focus.
Spacing, font size and shadow tokens are also available in flintsoft.css.
Override dark-theme tokens in [data-fs-theme="dark"] when customizing that theme.
Inputs
<FsText Label="Name" @bind-Value="model.Name" />
<FsText Label="Email" Type="email" @bind-Value="model.Email" />
<FsNumber TValue="decimal?" Label="Budget" Prefix="EUR" @bind-Value="model.Budget" />
<FsDate Label="Date" @bind-Value="model.Date" />
<FsTime Label="Time" @bind-Value="model.Time" />
<FsDateTime Label="Date and time" @bind-Value="model.DateTime" />
<FsTextArea Label="Notes" @bind-Value="model.Notes" />
<FsSelect TValue="string" Label="Team" @bind-Value="model.Team">
<option value="">Choose a team</option>
<option>Design</option>
</FsSelect>
<FsCheckbox Label="Send updates" @bind-Value="model.Updates" />
<FsRadioGroup TValue="string" Label="Plan" Options="plans" @bind-Value="model.Plan" />
Use IReadOnlyList<FsOption<TValue>> for radio options. Numeric types are short,
int, long, float, double, decimal, and their nullable equivalents.
Date and time bind to DateOnly?, TimeOnly? and DateTime? for combined values. Checkbox values are bool.
Text inputs support text, password, email, tel, url and search.
All inputs support Label, HelpText, Id, Disabled, ReadOnly, Prefix,
Suffix and additional HTML attributes. Binding works standalone and inside
EditForm with DataAnnotationsValidator. When not using @bind-Value, supply
ValueExpression alongside Value and ValueChanged, as with Blazor's built-in inputs.
Updates use onchange by default. Set UpdateOnInput="true" on text, textarea
or numeric inputs for keystroke updates. Invalid numeric text remains visible while
the last valid model value is preserved. Parsing errors are shown inside forms.
Nullable inputs map empty text to null. Numeric formatting/parsing uses the current
app culture; the demo uses de-DE to demonstrate decimal commas. Native date/time
values use browser-required invariant formats and are localized by the browser.
Use the application's normal Blazor localization configuration in Server or
WebAssembly; the library does not change the application's culture.
Autocomplete
FsAutocomplete<TItem> binds the selected TItem with @bind-Value. Supply an
asynchronous search callback and a function that returns the input text for a
selected item. Because it inherits InputBase<TItem?>, selection updates the
bound model property and participates in EditForm validation:
<EditForm Model="model">
<DataAnnotationsValidator />
<FsAutocomplete TItem="Customer" Label="Customer" @bind-Value="model.Customer"
SearchAsync="SearchCustomersAsync" GetText="customer => customer.Name">
<ItemTemplate Context="customer">
<strong>@customer.Name</strong>
<div>@customer.City</div>
</ItemTemplate>
</FsAutocomplete>
<ValidationMessage For="() => model.Customer" />
</EditForm>
@code {
private readonly EditModel model = new();
private async Task<IReadOnlyList<Customer>> SearchCustomersAsync(
string text, CancellationToken cancellationToken)
{
return await customerRepository.SearchAsync(text, cancellationToken);
}
}
ItemTemplate is optional; suggestions display GetText(item) by default.
Templates should contain display content, not interactive controls. ItemSelected
fires only for an explicitly chosen suggestion; the bound value is the selected
object itself. Typing is a draft and does not update the model until a suggestion
is selected.
With AllowNewValues="true", Enter or leaving the field commits typed text. For
TItem="string", the text itself becomes the bound value. For other item types,
provide CreateItemFromText="text => ..." to create the bound item from free text.
Search defaults to a 250ms debounce and one character minimum, configurable with
DebounceMilliseconds and MinimumLength. Focus searches the current text when it
meets the minimum; set MinimumLength="0" to search on empty focus. Honor the supplied
cancellation token for database/API calls. Obsolete results are ignored even if the
callback ignores cancellation. Search failures are logged and shown in the popup;
they are not treated as an empty result. Loading and empty messages can be customized
with LoadingText, NoResultsText and SearchErrorText.
No suggestion is automatically selected. Up/Down activates an entry, Enter commits
it, and mouse/touch selection also commits it. Escape or an outside click closes the
popup and cancels pending searches. Tab leaves without choosing a highlighted item.
Otherwise (the default), leaving restores the previous selected item's text, or
clears the input when there was no selection. UpdateOnInput is not used for this
control. An exact text match is not an implicit selection. Clear the bound value
from the parent to reset a restricted field. Changing the bound value externally
also resets the editor and pending search.
The component uses the existing floating label, affixes, help text and EditForm validation, along with ARIA combobox/listbox semantics. Suggestions are rendered after interactive events; no search or browser API runs during prerendering.
Panels
FsPanel provides the same themed surface, border, rounded corners and responsive
padding used throughout the demo. It works without any demo styles or services.
<FsPanel Title="Project details" Description="Give your idea a name." Badge="DRAFT">
<HeaderActions>
<FsButton Appearance="FsAppearance.Action" OnClick="Reset">Reset</FsButton>
</HeaderActions>
<ChildContent>
<FsText Label="Project name" @bind-Value="name" />
</ChildContent>
<Footer>
<FsButton OnClick="Save">Save project</FsButton>
</Footer>
</FsPanel>
Title, Description, Badge, HeaderActions and Footer are optional.
Use inline child content when not supplying named slots. A content-only panel
does not render an empty header or footer. Titles render as level-two headings
and label their section; titleless panels can supply aria-label.
Class adds custom CSS classes and additional HTML attributes are forwarded to
the section. The panel does not impose outer margins or create a form: place it
inside an EditForm, or place an EditForm in its body, when needed.
Personas
FsPersona shows a circular avatar that toggles a user card:
<FsPersona Name="Alex Morgan" Description="Product designer" ImageUrl="images/alex.jpg">
<ChildContent>
<a href="mailto:alex@example.com">alex@example.com</a>
<p>Design team / Vienna</p>
</ChildContent>
<Actions>
<a href="profile">View profile</a>
<FsButton OnClick="SignOut">Sign out</FsButton>
</Actions>
</FsPersona>
ImageUrl is optional. Without an image (or if it fails to load), the avatar uses
Initials, or derives initials from the first and last words of Name. Without
either it displays ?; set AccessibleLabel to localize the default "User profile"
label when no name is supplied. Images are decorative because the button is named.
Description, ChildContent and Actions are optional. Use inline child content
when not supplying named slots. Actions accepts ordinary links, buttons or other
components; clicking them does not automatically dismiss the card.
Click the avatar again, click outside, press Escape, or move keyboard focus outside
to close. The avatar is a native button supporting Enter and Space; Tab reaches
the card's links and buttons, and Escape returns focus to the avatar. The card is
non-modal and does not trap focus. Class and additional HTML attributes apply to
the outer wrapper. Styles use the same light/dark tokens as other components;
JavaScript attaches only after interactive rendering and cleans up on removal.
Settings
FsSettings displays the library's gear icon in a button and toggles a flyout
containing arbitrary ChildContent:
<FsSettings>
<a href="profile">Profile settings</a>
<FsButton OnClick="SaveSettings">Save settings</FsButton>
</FsSettings>
Click the gear again, click outside, press Escape, move keyboard focus outside, or activate a link inside the flyout to close. Buttons, inputs and other controls inside remain interactive without dismissing automatically. Enter and Space toggle the button, Tab reaches the content, and Escape returns focus to the gear. The flyout is non-modal, not an ARIA menu, so it can contain links, buttons, inputs, or other components.
AccessibleLabel defaults to "Settings" and labels both the button and flyout.
Class and additional HTML attributes apply to the outer wrapper. It supports
the library's light/dark themes and interactive Server and WebAssembly rendering.
Adorners
FsAdorner displays a full-screen overlay while IsLoading is true (false by
default). Its content is centered horizontally and vertically in the viewport.
<FsAdorner IsLoading="_loading" />
<FsAdorner IsLoading="_loading">
<p>Preparing your workspace...</p>
</FsAdorner>
Without ChildContent, it displays LoadingText (default "Loading...").
Custom child content replaces that message completely and can include components.
The content is exposed as a polite status announcement. Class and additional
HTML attributes apply to the overlay; styling uses the light/dark theme tokens.
Set IsLoading back to false when the operation finishes, preferably in a finally
block. Clicking outside or pressing Escape does not dismiss it. The overlay
intercepts pointer clicks but is not a modal dialog and does not trap keyboard
focus; disable underlying controls while busy if they must not be used.
Place it near the layout root, outside ancestors with transforms, clipping, or
isolated stacking contexts, so its fixed positioning covers the viewport.
Native modal dialogs occupy the browser's top layer; place an adorner inside
the modal when showing loading over a modal. No JavaScript or services are required.
Buttons
<FsButton OnClick="Save">Save</FsButton>
<FsButton Type="submit">Submit</FsButton>
<FsButton Appearance="FsAppearance.Danger" Disabled="busy">Delete</FsButton>
Appearances: Primary, Secondary, Action, Danger, Success.
The default HTML type is button, not submit.
Modals
<FsModal @ref="modal" Title="Edit project" OnOpening="LoadAsync" OnClosed="Closed">
<FsText Label="Name" @bind-Value="name" />
</FsModal>
@code {
private FsModal modal = default!;
private string? name;
private Task LoadAsync() { name = "Example"; return Task.CompletedTask; }
private void Closed(FsCloseReason reason) { }
private Task Open() => modal.OpenAsync();
}
OpenAsync awaits initialization before scheduling the dialog for display.
Initialization errors propagate to the caller. A second concurrent open throws;
close the active modal first. Call CloseAsync() to close programmatically.
OnClosed reports Programmatic, CloseButton, Escape or Backdrop.
CloseOnEscape and CloseOnBackdrop default to true.
OpenAndWaitForCloseAsync() opens the modal and completes when it closes,
returning the close reason. This enables wrapper components that expose
awaitable OpenAsync(...) methods and return edited/new data to the caller.
For a titleless modal, provide AccessibleLabel.
Native dialogs provide modal background isolation and keyboard focus containment.
The JavaScript module locks body scrolling and restores focus/scroll on closure or
component removal. Modern browsers with native <dialog> support are required.
Toasts
Toasts.Show("Saved.", FsToastStyle.Success, title: "All done");
var id = Toasts.Show("Close this when ready.", duration: TimeSpan.Zero);
Toasts.Dismiss(id);
Inject FsToastService; render one FsToastHost per interactive application scope.
Styles: Info, Success, Danger, Warning. An overload accepts RenderFragment.
The default duration is five seconds; zero means manual dismissal only. Negative
durations throw. Hover and focus pause dismissal; leaving restarts the full duration.
Timers start after interactive rendering and are canceled when toast items are removed.
In Interactive Server, invoke the service from the circuit's renderer context
(use InvokeAsync when publishing from background work).
Tables
FsTable<TItem> accepts IReadOnlyList<TItem> Items and
IReadOnlyList<FsColumn<TItem>> Columns. Each column has a header, a
RenderFragment<TItem> cell template, an optional CSS class and an optional
RenderFragment HeaderTemplate.
Put buttons or other components in cell templates for row actions.
<FsTable TItem="Person" Items="people" Columns="columns" Caption="Team"
RowKey="person => person.Id" Loading="loading">
<Actions>
<FsButton OnClick="OpenCreate">New member</FsButton>
</Actions>
<EmptyContent>No team members yet.</EmptyContent>
</FsTable>
The optional Actions fragment renders beside the title inside the table caption,
right-aligned and wrapping on narrow screens. Use it for table-level actions such as creating
an entry, refreshing or exporting. Actions remain available in loading and empty
states; the caller controls their click handlers and disabled state. Without
Actions, no toolbar is rendered.
Use stable, unique RowKey values for mutable data. EmptyContent and
LoadingContent customize state messages. At widths up to 600px, each row becomes
a stacked card with column labels, all values and row actions visible without
horizontal scrolling. Header supplies the mobile label even when using a
HeaderTemplate. The same table markup and accessible column headers are retained;
desktop keeps the normal table layout. Cell templates should allow their content
to wrap instead of imposing fixed widths. Sorting, filtering, paging, selection, virtualization and
server-side data management are intentionally not included.
Release checks
Install the browser once after building the browser-test project:
dotnet build tests\FlintSoft.Components.BrowserTests
pwsh tests\FlintSoft.Components.BrowserTests\bin\Debug\net10.0\playwright.ps1 install chromium
The browser suite starts and stops its own local demo and WebAssembly hosts.
dotnet test FlintSoft.Components.slnx
dotnet pack src --configuration Release
Review the demo in both themes and on narrow screens before publishing the preview.
| Product | Versions 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. |
-
net10.0
- Microsoft.AspNetCore.Components.Web (>= 10.0.13)
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 |
|---|---|---|
| 2.0.35 | 44 | 11/24/2026 |
| 2.0.34 | 49 | 11/24/2026 |
| 2.0.33 | 103 | 11/15/2026 |
| 2.0.32 | 97 | 11/13/2026 |
| 2.0.31 | 91 | 11/13/2026 |
| 2.0.30 | 97 | 11/13/2026 |
| 2.0.29 | 90 | 11/12/2026 |
| 2.0.27 | 99 | 11/2/2026 |
| 2.0.26 | 96 | 11/2/2026 |
| 2.0.25 | 88 | 11/2/2026 |
| 2.0.24 | 101 | 11/2/2026 |
| 2.0.23 | 97 | 11/2/2026 |
| 2.0.22 | 107 | 10/30/2026 |
| 2.0.21 | 94 | 10/30/2026 |
| 2.0.20 | 108 | 10/29/2026 |
| 2.0.19 | 101 | 10/28/2026 |
| 2.0.18 | 102 | 10/28/2026 |
| 2.0.17 | 111 | 10/28/2026 |
| 2.0.16 | 106 | 10/28/2026 |
| 2.0.15 | 104 | 10/27/2026 |