Skip to content

Overview

The hub of the Klyroo ecosystem: one meta-package that registers every Klyroo library, an MCP server that gives coding agents the Klyroo.UI documentation, and dotnet new templates, for .NET developers who build Blazor and .NET MAUI Blazor Hybrid apps.

On this page

Klyroo is a family of independent .NET libraries, each in its own repository with its own versions. This repository ties them together: Klyroo.Stack references the Blazor package of all eight libraries and registers them with one call, Klyroo.Stack.Core does the same for their headless engines, and the templates and the MCP server start a project or an AI session with the right packages and documentation. You can use the hub, or ignore it and install one library on its own.

Prerequisites

To use the library in an app:

  • The .NET 10 or .NET 11 SDK, and an app that targets net10.0 or net11.0. The packages are prereleases, so every dotnet add package command needs --prerelease.
  • A Blazor app for Klyroo.Stack: a Blazor Web App or a .NET MAUI Blazor Hybrid app. Interactive components need an interactive render mode (Interactive Server, WebAssembly or Auto). In a WebAssembly or Auto app, register the services in the server project and in the .Client project.
  • Klyroo.UI set up in the app. AddKlyrooStack() registers every library, but the layout still needs the Klyroo.UI stylesheets in <head> and <KlyApp> around the body, as described in the Klyroo.UI installation.
  • A browser with the native popover API, which Klyroo.UI uses: Chrome and Edge 114, Safari 17 or Firefox 125, or later. In a .NET MAUI app, that means iOS or Mac Catalyst 17, or an Android System WebView 114 or later.
  • Network access on the first build only if your app self-hosts web fonts (KlyrooFont), uses icons outside the built-in set, or compiles Tailwind (KlyrooTailwind): the build downloads them once and caches them under obj/klyroo. Node.js is not needed.
  • For the MCP server: the .NET 10 runtime or newer, to run the Klyroo.Stack.Mcp .NET tool, and an MCP client (Claude Code, VS Code, Cursor...).
  • For the project templates: dotnet new install Klyroo.Templates; the klyroo-maui template also needs the .NET MAUI workload (dotnet workload install maui) and the SDKs of the platforms you target.

To build this repository you need the .NET 11 SDK (a newer SDK works too, see global.json) and clones of klyroo-agent, klyroo-dashboard, klyroo-display, klyroo-form, klyroo-query, klyroo-spreadsheet, klyroo-table and klyroo-ui in the same parent folder: some projects reference them by relative path (../klyroo-agent/...). See Contributing.

Installation

The meta-package

Shell
dotnet add package Klyroo.Stack --prerelease

Register the libraries in Program.cs (or MauiProgram.cs), load the stylesheets, and import the namespaces you use:

C#
using Klyroo.Stack;

builder.Services.AddKlyrooStack();
Razor
<KlyColorModeScript />
<KlyCultureMeta />
<KlyThemeStyle />
<link rel="stylesheet" href="@Assets["_content/Klyroo.UI/klyroo.preflight.css"]" />
<link rel="stylesheet" href="@Assets["_content/Klyroo.UI/klyroo.css"]" />
<link rel="stylesheet" href="@Assets["_content/Klyroo.Stack/klyroo-stack.css"]" />

The three components go before the stylesheets: the first applies the stored color mode before the first paint, the second writes the culture of the request so a WebAssembly client formats like the prerender, and the third sends the theme variables. In a .NET MAUI Blazor Hybrid app, which has no server to render <head>, use <KlyHead /> in the layout instead.

In an app with a WebAssembly client, call AddKlyrooStack() in the server and in the client Program.cs with the same options. Getting started walks through a complete project.

Individual libraries

Each library has its own registration method and its own repository. AddKlyrooTable() also registers Klyroo.UI and Klyroo.Query, and AddKlyrooForm(), AddKlyrooDashboard(), AddKlyrooDisplay() and AddKlyrooSpreadsheet() also register Klyroo.UI, so you can call only the ones you use:

Shell
dotnet add package Klyroo.Table --prerelease
dotnet add package Klyroo.Form --prerelease
C#
using Klyroo.Form;
using Klyroo.Table;

builder.Services.AddKlyrooTable();
builder.Services.AddKlyrooForm();

Each Blazor package ships its own stylesheet next to the Klyroo.UI one when it has components (for example _content/Klyroo.Table/klyroo-table.css). The headless engines install the same way: dotnet add package Klyroo.Stack.Core --prerelease.

The MCP server

Shell
dotnet tool install --global Klyroo.Stack.Mcp --prerelease
claude mcp add --transport stdio klyroo -- klyroo-stack-mcp

The server covers the components of Klyroo.UI and the Klyroo.Table components that the documentation site describes. It also carries the documentation pages (getting started, guides, concepts, platforms, FAQ and API reference) of Klyroo.Query, Table, Form, Dashboard, Display, Spreadsheet and Agent, at paths such as /form/docs/guides, which search-documentation and get-documentation-page read. See the package page for the tools, prompts, resources, options and client configuration.

Project templates

Shell
dotnet new install Klyroo.Templates::0.1.0-preview.1
Short name Creates
klyroo-saas Blazor Web App for a SaaS product: a header with navigation and a color mode button, a dashboard, a filterable accounts list with a form drawer, and a usage page of read-only blocks
klyroo-admin Blazor Web App for a back office: a sidebar shell, a dashboard, a customer list with selection and bulk actions, a customer page, and a spreadsheet import
klyroo-headless Console app with PublishAot that uses Klyroo.Stack.Core only
klyroo-maui .NET MAUI Blazor Hybrid app for Android, iOS, Mac Catalyst and Windows, see Platforms
Shell
dotnet new klyroo-saas -n MyShop
cd MyShop
dotnet run

Both web templates take --interactivity Server|WebAssembly|Auto (Server by default). Server is one project; WebAssembly and Auto add a .Client project that holds the pages, the layout and the sample data, and a solution file. The pages show a product name written from the project name (MyShop becomes "My Shop"); --product-name "Acme Cloud" sets another. The app loads the three precompiled stylesheets, so it needs neither Node nor a Tailwind build, and its own layout classes live in wwwroot/app.css: see Style a generated app for what that means for the classes you write. Start a project from a template describes each page.

The templates reference the Klyroo packages at the version of the Klyroo.Templates package that you installed: the version is written into each template when the package is built, so a new release changes it in one place. The CI job templates-from-local-feed packs the nine repositories into a local feed, installs the templates from it, generates the templates, builds them against that feed alone, runs the web apps and publishes the headless one with NativeAOT; Verify the templates against local packages shows the two commands that reproduce it.

The klyroo-saas and klyroo-admin templates were generated in all three interactivity modes, built against locally packed packages, run, and loaded in headless Chrome without console errors.

Run the documentation site locally

The site in site/ is a Blazor Web App (Interactive Server and WebAssembly). It references the sibling repositories by relative path, so clone klyroo-ui, klyroo-query, klyroo-table, klyroo-form, klyroo-dashboard, klyroo-display, klyroo-spreadsheet and klyroo-agent next to this repository, then:

Shell
dotnet run --project site/Klyroo.Stack.Site

The site also hosts live demos of templates as child processes. Set Klyroo__Templates__Enabled=false to start it without them.

The playground

playground/Klyroo.Playground is a standalone Blazor WebAssembly app with one interactive page per library (/ui/, /query/, /table/, /form/, /dashboard/, /display/, /spreadsheet/, /agent/) and an index. The result is drawn by the real components and engines running in the browser on sample data, the knobs are real parameters of the library, the code beside the result follows the knobs and can be copied, and the knobs and the state of the lists are kept in the address, so a link restores a view. It needs no server. Publish it for GitHub Pages with:

Shell
build/publish-playground.sh <out-dir> [base-path]   # base-path defaults to /klyroo-stack/playground/
python3 -m http.server 8000 --directory <parent-of-out-dir>

The script writes the app, a 404.html that restores the route on GitHub Pages (a deep link such as /klyroo-stack/playground/table/?q=ada lands on it, since Pages has no server routes) and .nojekyll. The documentation sites link to it from their header and from the home page of each library (playground in docs-site/Klyroo.Docs.Site/libraries.yml).

Quick start

Headless first. Klyroo.Stack.Core brings the query engine of Klyroo.Query, so you can filter, sort and page data without any UI:

C#
using Klyroo.Query;
using Klyroo.Stack;

var module = KlyrooStackCatalog.ResolveComponentModule("KlyDataList<Product>")!;
Console.WriteLine($"{module.Name}: {module.CorePackage} + {module.UiPackage}");

var schema = DataListSchema.For<Product>(s => s
    .RowKey(p => p.Id)
    .Search(p => p.Name)
    .Field(p => p.Name, f => f.Key("name").Sortable())
    .Field(p => p.Price, f => f.Key("price").Sortable()));

var request = new DataListRequest(
    DataListPaging.Offset.ForPage(1, 10),
    [new DataListSort("price", Descending: true)],
    DataListFilterGroup.Empty);

var result = schema.ExecuteInMemory(
    [new Product(1, "Keyboard", 120m), new Product(2, "Monitor", 350m), new Product(3, "Mouse", 40m)],
    request);

Console.WriteLine($"{result.TotalCount} products, most expensive first: {result.Items[0].Name}");

sealed record Product(int Id, string Name, decimal Price);

This prints Klyroo.Table: Klyroo.Table.Core + Klyroo.Table and 3 products, most expensive first: Monitor.

Then Blazor. With AddKlyrooStack() registered and the stylesheets loaded, wrap your router in <KlyApp> and use the components:

Razor
@page "/"
@inject FormService Forms

<KlyDashboardStat Label="Active accounts" Value="128" Compare="112" />
<KlyButton Label="New account" Color="KlyColor.Primary" OnClick="OpenFormAsync" />

@code {
    private sealed class Account
    {
        public string Name { get; set; } = "";
    }

    private static readonly FormSchema<Account> NewAccount = FormSchema.For<Account>(s =>
    {
        s.FormKey = "new-account";
        s.Title = "New account";
        s.Field(a => a.Name, f => f.Label("Company name").Required());
    });

    private Task OpenFormAsync() => Forms.CreateFormAsync(NewAccount, mode: FormShellMode.Drawer);
}

The page needs <KlyFormProvider /> inside <KlyApp> to show the drawer, as in the templates.

Documentation

Getting started Step-by-step first integration
Guides Task-oriented recipes
Concepts How the library works
Platforms Render modes, .NET MAUI, NativeAOT
API reference Every public type and member
FAQ Troubleshooting and limitations

Compatibility

  • .NET 11 SDK. global.json pins SDK 10.0.100 and rolls forward to a newer major.
  • Blazor render modes: Klyroo.UI documents Static SSR, Interactive Server, WebAssembly and Auto. The hub site runs Interactive Server and WebAssembly.
  • .NET MAUI Blazor Hybrid: Klyroo.Stack declares browser, ios, android, maccatalyst and windows as supported platforms. According to the Klyroo.UI documentation only Android has been run on an emulator so far.
  • NativeAOT and trimming: Klyroo.Stack.Core is IsAotCompatible and IsTrimmable. Klyroo.Stack is IsTrimmable but not declared AOT compatible.
  • The tools and templates need the .NET 10 runtime or newer.

Contributing

Contributions are welcome. Read CONTRIBUTING.md before opening a pull request, and follow the code of conduct. Report security issues privately as described in SECURITY.md.

License

MIT