FlintSoft.Components 2.0.35

dotnet add package FlintSoft.Components --version 2.0.35
                    
NuGet\Install-Package FlintSoft.Components -Version 2.0.35
                    
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="FlintSoft.Components" Version="2.0.35" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FlintSoft.Components" Version="2.0.35" />
                    
Directory.Packages.props
<PackageReference Include="FlintSoft.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 FlintSoft.Components --version 2.0.35
                    
#r "nuget: FlintSoft.Components, 2.0.35"
                    
#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 FlintSoft.Components@2.0.35
                    
#: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=FlintSoft.Components&version=2.0.35
                    
Install as a Cake Addin
#tool nuget:?package=FlintSoft.Components&version=2.0.35
                    
Install as a Cake Tool

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.

Markdown editor

FsMarkdownEditor edits Markdown text and updates its bound value as the user edits, including toolbar and image-paste changes. It supports EditForm, labels, help text, disabled and read-only states, and Rows; a null value displays as empty. It does not render Markdown or sanitize HTML. Applications that render untrusted Markdown must sanitize the resulting HTML themselves.

<FsMarkdownEditor Label="Document" @bind-Value="document" ProcessPasteAsync="SaveImageAsync" />

@code {
    private string? document;
    private async Task<string> SaveImageAsync(FsMarkdownPaste image)
    {
        // Upload image.Data after validating its type and size, then return its URL.
        return await imageStore.SaveAsync(image.Data, image.ContentType, image.FileName);
    }
}

The default toolbar offers bold, italic, headings 1-3, bulleted and numbered lists, code blocks, links and quotes. Supply a named Toolbar to replace it. Call the editor reference's BoldAsync, ItalicAsync, HeadingAsync(int), BulletedListAsync, NumberedListAsync, CodeAsync, LinkAsync and QuoteAsync methods to use the same actions from custom buttons:

<FsMarkdownEditor @ref="editor" Label="Notes" @bind-Value="document">
    <Toolbar>
        <button type="button" @onclick="MakeBold">Bold</button>
    </Toolbar>
</FsMarkdownEditor>
@code {
    private FsMarkdownEditor editor = default!;
    private string? document;
    private Task MakeBold() => editor.BoldAsync();
}

Formatting uses the last textarea selection. Bold, italic and link actions leave leading and trailing selected whitespace outside the markup; whitespace-only selections are unchanged. Link insertion asks for a URL using the browser prompt. Enter continues a list at the end of a line; Enter on an empty item exits the list. Tab moves focus normally so keyboard users can leave the editor. Ctrl+] (Command+] on macOS) indents the selection or inserts a tab at the caret.

ProcessPasteAsync is optional and receives a FsMarkdownPaste containing bytes, content type and the browser-supplied filename. It must return a non-empty image path or URL, inserted as ![Image](...) with whitespace and parentheses URL-escaped. Ordinary text paste, and image paste when no handler is supplied, use the browser's native behavior. An intercepted image paste cannot fall back to native paste after an async handler starts. The default MaxPasteSize is 10 MiB; change it to suit your application and enforce additional server-side upload and content validation. The image is transferred over JS interop and held in memory; on Interactive Server it also crosses the circuit. Markdown updates send the full text through the circuit; configure the host's SignalR receive limit if documents can exceed its default. Only one image paste can be pending per editor. If its text changes, the editor becomes read-only or disabled, or another image is pasted before processing finishes, the affected insertion is rejected and an error is displayed and logged. Customize the displayed message with PasteErrorText. The demo uses a temporary browser object URL that is revoked on leaving the page; production apps normally store the image and return its durable URL.

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.

Context menus

FsContextMenu toggles arbitrary ChildContent using your own text or icon:

<FsContextMenu Text="More actions">
    <a href="profile">View profile</a>
    <FsButton OnClick="Save">Save</FsButton>
</FsContextMenu>

<FsContextMenu AccessibleLabel="Project actions" Alignment="FsContextMenuAlignment.Right">
    <Icon><FlintSoft.Components.Icons.Menue /></Icon>
    <ChildContent>
        <FsButton OnClick="Save">Save</FsButton>
    </ChildContent>
</FsContextMenu>

Text and the Icon render fragment can be used separately or together. With no icon or text, the trigger displays "Actions". AccessibleLabel names the trigger and flyout; it falls back to Text, then "Actions". Supply a descriptive label for icon-only triggers. The Icon slot is decorative and should not contain buttons or links because it renders inside the trigger button. The button has no default button chrome. The flyout sizes to its content with compact padding, up to the viewport width, and is positioned over surrounding content without changing layout; an ancestor with clipping overflow can still clip it.

Alignment controls horizontal positioning below the trigger: Left aligns the right edges (extending left), Center centers the flyout, and Right aligns the left edges (extending right). These are physical directions even in right-to-left layouts. The default retains the original inline-end alignment, which extends left in left-to-right layouts and right in right-to-left layouts. The flyout shifts as needed to fit the viewport, so it may not retain the requested alignment near an edge.

Click or tap the trigger again to close. Clicking outside, moving focus outside, or pressing Escape also closes it; Escape returns focus to the trigger. Enter and Space toggle the native button, and Tab reaches child controls. By default, child actions do not automatically close the flyout; set CloseOnContentClick="true" to dismiss when clicking links, buttons, or menuitem-role elements inside the flyout. This is a non-modal flyout, not an ARIA menu: child content can include ordinary links, buttons, inputs, and components without menu-specific roles or arrow-key navigation. Class and additional HTML attributes apply to the wrapper. Light/dark themes and interactive Server and WebAssembly rendering use the same flyout behavior as FsSettings.

Trees

FsTree<TItem> renders arbitrary application data through FsTreeItem<TItem> wrappers. IDs must be stable, non-empty, case-sensitive strings, unique within a single tree. Cycles, duplicate placement, and null children collections are rejected. Text is the default label and type-ahead text; Value holds your domain object. Depth is inferred from Children, not stored in the model.

<FsTree TItem="Customer" Items="nodes" AccessibleLabel="Customers"
        ExpansionRequested="Expanding" ItemClickRequested="Clicking"
        ItemClicked="Clicked" ItemDropped="DroppedAsync" />

@code {
    private IReadOnlyList<FsTreeItem<Customer>> nodes = [];

    private void Expanding(FsTreeExpansionRequestEventArgs<Customer> request)
    {
        // Leave Default to use configuration, or explicitly override it.
        request.Decision = FsTreeDecision.Allow;
    }

    private void Clicking(FsTreeItemClickRequestEventArgs<Customer> request)
    {
        if (request.Item.Value is { Archived: true }) request.Decision = FsTreeDecision.Deny;
    }

    private void Clicked(FsTreeItemClickedEventArgs<Customer> args)
    {
        // args.Item is the clicked node; args.Item.Value is the Customer.
    }

    private async Task DroppedAsync(FsTreeDropEventArgs<Customer> args)
    {
        await store.MoveAsync(args.Id, args.TargetParentId, args.TargetIndex, args.CancellationToken);
        nodes = await store.LoadTreeAsync(args.CancellationToken);
    }
}

The example assumes your application's Customer type and store. See /trees in Demo for a complete in-memory example, including rejected saves.

Expansion and activation policy

IsExpandable and IsClickable are nullable per-item defaults. Expansion uses item.IsExpandable ?? DefaultIsExpandable ?? (item.Children.Count > 0); DefaultIsExpandable defaults to null. Activation uses item.IsClickable ?? DefaultIsClickable; DefaultIsClickable defaults to true.

Both request callbacks are awaited before checking these policies. Their mutable Decision starts at FsTreeDecision.Default (use config); Allow overrides even an explicit false, and Deny overrides true. Overrides affect one interaction only, not the item's properties. Disabled is an absolute block. Callbacks receive the node, ID, parent ID, and a cancellation token. Expansion also provides IsExpanded and RequestedExpanded. Collapse defaults to allowed regardless of expand policy, but an explicit Deny may veto it.

Disclosure clicks only expand/collapse; they never activate/select. Accepted label clicks or Enter/Space activate and select without implicit expansion or navigation. ItemClicked fires once per accepted activation, including repeats, and exposes Item, Id, and actual SelectedId. ExpandedChanged reports an applied change through Item, Id, and IsExpanded. Denials do not emit completed callbacks. Selection binding is notified before ItemClicked; expansion binding is notified before ExpandedChanged. Callback failures propagate to Blazor error handling.

Populated branches display a right chevron when collapsed and a down chevron when expanded. Childless items never display a disclosure chevron, even with an expansion handler or IsExpandable = true. Expansion policy and its event overrides still apply: use Right/Left arrows or RequestExpansionAsync from a custom action for an unloaded branch. Lazy loading can await data inside ExpansionRequested, then assign request.Item.Children; its chevron appears once children exist. Keep the pending node object itself stable; replacing/removing it cancels that request. Set IsExpandable = true for unloaded branches and use EmptyChildrenContent for an expanded branch with no children. Duplicate requests on one node are suppressed; independent nodes can load concurrently. Honor the supplied cancellation token.

Use @bind-ExpandedIds (IReadOnlyCollection<string>?) and @bind-SelectedId (string?) for controlled state. Null ExpandedIds means internal expansion state; an empty collection means controlled and collapsed. Supplying SelectedId, even null, makes selection controlled. Omit it for internal selection. A parent may reject a proposed state update; the component does not mutate parameter collections or retain an optimistic second copy. Stale IDs are ignored, stable IDs preserve state across replacement objects, and programmatic updates do not replay user request events. Collapsing keeps descendant state and selection.

Drag-and-drop and persistence

Set IsDraggable = true on sources and CanAcceptDrop = true on destinations; both default to false. These permissions are independent of expansion/activation. A non-draggable node may receive drops. An ItemDropped handler is required to enable moving. Nodes move into a destination, appended to its children; same-parent, self/descendant, external, stale, and cross-tree drops are rejected. Root nodes can move into another node; root-background drops and sibling reordering are not supported.

ItemDropped is awaited once per valid drop and contains:

  • Items: the current full root collection (references, not a deep snapshot).
  • Item / Id: the dragged node, whose Value is your payload.
  • SourceParent / SourceParentId: null for a root source.
  • TargetParent / TargetParentId: the receiving node.
  • SourceIndex: original zero-based index; TargetIndex: proposed append index.
  • CancellationToken: disposal or relevant hierarchy invalidation.

A valid drop is intent, not successful persistence. Unlike the source JavaScript's structure-move event, this callback runs before any hierarchy change: the component never moves nodes in caller-owned collections. Save the parent/order change in the callback, then update/reload Items or Children. If rejected, leave the hierarchy unchanged and display the reason. Handle recoverable save failures visibly or let an ErrorBoundary handle exceptions; there is no false successful move or automatic rollback of application side effects. Revalidate authorization and concurrency in your data source, not via browser flags.

Further moves are blocked while a drop is pending. Native drag highlighting is cleaned up on cancel/removal/disposal. Moves preserve selection/expansion by ID, do not auto-expand destinations or activate nodes, and suppress drag-generated clicks. The built-in Move an item disclosure provides keyboard/touch-accessible source/destination selects using the same validation and callback. Public MoveAsync, RequestExpansionAsync, and ActivateAsync methods support custom UI.

Presentation and keyboard

Every FsTreeItem<TItem> initializer must explicitly set the required bool ShowActions. Set it to false for rows without actions, or true to render the optional Actions template beside that node's label. The template receives the node and may contain icon buttons, a context menu, or other controls. No action container is rendered when ShowActions is false or the template is absent. Changing ShowActions takes effect on the next render.

<FsTree TItem="string" Items="nodes">
    <Actions Context="node">
        <button type="button" aria-label="@($"Add child to {node.Text}")" @onclick="() => AddChild(node)">
            <span aria-hidden="true"><FlintSoft.Components.Icons.Plus /></span>
        </button>
        <FsContextMenu AccessibleLabel="@($"More actions for {node.Text}")">
            <Icon><FlintSoft.Components.Icons.Ellipsis Style="transform: rotate(90deg)" /></Icon>
            <ChildContent></ChildContent>
        </FsContextMenu>
    </Actions>
</FsTree>

Initialize nodes, for example, with new FsTreeItem<string> { Id = "team", Text = "Team", ShowActions = true }. The application implements AddChild and publishes updated Children. Actions are isolated from row activation, expansion, and native drag-start; no extra click propagation modifiers are needed inside Actions. Native controls in the slot are disabled with the tree. Give icon-only buttons accessible names and use type="button" to avoid form submission. Custom non-native controls must honor the disabled state themselves. The slot does not perform application operations.

ItemTemplate still customizes label content. Embedded buttons/links in that label must use @onclick:stopPropagation to avoid activating the node; prefer Actions for these controls. EmptyContent, EmptyChildrenContent, Class, additional wrapper attributes, and AccessibleLabel (default "Tree") customize presentation. Styles use light/dark --fs-* tokens. Use arrows, Home/End, and type-ahead to navigate visible nodes; Right/Left also request expansion/collapse. Focus does not select. Tab leaves the tree normally. Interactive Server, WebAssembly, and prerendering are supported; browser behavior attaches only after interactive rendering and is disposed on removal.

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>
<FsButton Compact OnClick="OpenRowDetails">Details</FsButton>

Appearances: Primary, Secondary, Action, Danger, Success. The default HTML type is button, not submit. Set Compact for denser layouts (for example table row actions): it removes button padding and uses a smaller minimum height.

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 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

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
Loading failed