Overview
Accessible Blazor components styled with Tailwind CSS v4, for .NET developers who build web apps and .NET MAUI Blazor Hybrid apps.
On this page
Klyroo.UI gives a Blazor app a complete set of components, a design system built on CSS variables and a build that
bundles icons, fonts and Tailwind for you. Opening, closing, focus and keyboard handling run in the browser, so the
components work in static server rendering, Interactive Server, WebAssembly and Auto, and in a BlazorWebView.
Components
Every component name starts with Kly, so Button is KlyButton. The list counts the 143 public components that you place in a page.
The records they take (KlyTabItem, KlySelectItem, ...), the *Ui slot records, the base classes and the internal helper components
that the API reference also lists are not counted.
- Elements (20): Button, Badge, Avatar, AvatarGroup, Card, Alert, Banner, Chip, Container, Empty, FieldGroup, Icon, Image, InfiniteScroll, Kbd, Link, Progress, Separator, Skeleton, User
- Form (25): Form, FormField, Input, InputNumber, InputTags, InputMenu, InputDate, InputTime, InputRating, PinInput, Textarea, Checkbox, CheckboxGroup, Switch, RadioGroup, Select, SelectMenu, Listbox, Slider, RangeSlider, Toggle, ToggleGroup, Calendar, ColorPicker, FileUpload
- Overlay (9): Modal, Slideover, Drawer, Popover, Tooltip, DropdownMenu, ContextMenu, CommandPalette, Toaster
- Color mode (5): ColorModeButton, ColorModeSwitch, ColorModeSelect, ColorModeAvatar, ColorModeImage
- Navigation (12): Tabs, Accordion, Collapsible, Breadcrumb, Pagination, Stepper, Timeline, NavigationMenu, Tree, Marquee, ScrollArea, Splitter
- Content (5): ContentNavigation, ContentSearch, ContentSearchButton, ContentSurround, ContentToc
- Data (4): Table, Column, Chart, Carousel.
KlyTableis a simple client-side table over a list you already hold; for server data, paging and filters use Klyroo.Table - Layout (10): App, Header, Main, Footer, FooterColumns, Sidebar, SkipLink, Error, LocaleSelect, Theme
- Page (23): Page, PageHeader, PageHero, PageSection, PageFeature, PageGrid, PageColumns, PageCard, PageCta, PageLinks, PageList, PageLogos, PageAnchors, PageAside, PageBody, AuthForm, PricingPlan, PricingPlans, PricingTable, BlogPost, BlogPosts, ChangelogVersion, ChangelogVersions
- Dashboard (10): DashboardGroup, DashboardSidebar, DashboardSidebarCollapse, DashboardSidebarToggle, DashboardPanel, DashboardResizeHandle, DashboardNavbar, DashboardToolbar, DashboardSearch, DashboardSearchButton
- Chat (9): ChatMessages, ChatMessage, ChatPrompt, ChatPromptSubmit, ChatPalette, ChatAttachment, ChatReasoning, ChatShimmer, ChatTool
- Editor (6): Editor, EditorToolbar, EditorDragHandle, EditorSuggestionMenu, EditorMentionMenu, EditorEmojiMenu
- Head (5): ColorModeScript, CultureMeta, Fonts, Head, ThemeStyle (the components that go in
<head>)
Prerequisites
To use the library in an app:
- The .NET 11 SDK, and an app that targets
net11.0. The packages are prereleases, so everydotnet add packagecommand needs--prerelease. - A Blazor app: a Blazor Web App (static server rendering, Interactive Server, WebAssembly or Auto) or a .NET MAUI Blazor Hybrid app. Components that call .NET when the user acts (
OnClick,@bind-Open) need an interactive render mode; the others also work in static server rendering. In a WebAssembly or Auto app, register the services in the server project and in the.project.Client - 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 underobj/. Node.js is not needed.klyroo - Tailwind CSS is optional. Without it, link the precompiled stylesheets. With Tailwind v4 in your app, turn on
KlyrooTailwind: the build runs the Tailwind standalone binary, so no Node.js either.
To build this repository you need the .NET 11 SDK (a newer SDK works too, see global.) and clones of klyroo-query and klyroo-stack (klyroo-query and klyroo-stack are used by the test projects only) in the same parent folder: some projects reference them by relative path (../). See Contributing.
Installation
dotnet add package Klyroo.UI --prereleaseRegister the services in the server Program. and, for a WebAssembly or Auto app, in the . project with the
same configuration:
using Klyroo.UI;
builder.Services.AddKlyrooUi();Import the namespace in _:
@using Klyroo.UILoad the styles in <head> of App.. Without Tailwind in your app, link the precompiled sheets:
<KlyColorModeScript />
<KlyThemeStyle />
<link rel="stylesheet" href="@Assets["_content/Klyroo.UI/klyroo.preflight.css"]" />
<link rel="stylesheet" href="@Assets["_content/Klyroo.UI/klyroo.css"]" />If your app compiles Tailwind v4, turn on KlyrooTailwind in the project file, import the Klyroo theme after Tailwind and
load your own compiled sheet instead:
<PropertyGroup>
<KlyrooTailwind>true</KlyrooTailwind>
</PropertyGroup>@import "tailwindcss";
@import "../obj/klyroo/klyroo.theme.css";Remove Bootstrap if the Blazor template added it: CSS outside a cascade layer overrides the layered CSS of Tailwind v4.
Quick start
Wrap the layout in KlyApp, once, around the body. It renders the toaster and the host of IKly (dialogs opened from code), resolves the locale and writes lang and dir:
@inherits LayoutComponentBase
<KlyApp>
<KlyMain>
@Body
</KlyMain>
</KlyApp>Then use the components:
@page "/settings"
<KlyFormField Label="Display name">
<KlyInput @bind-Value="_name" Placeholder="Ada Lovelace" />
</KlyFormField>
<KlySwitch @bind-Value="_notify" Label="Email notifications" />
<KlyPopover>
<ChildContent><KlyButton Label="Details" Variant="ButtonVariant.Outline" /></ChildContent>
<Content><p class="p-3">Opens and closes in the browser, with no round trip.</p></Content>
</KlyPopover>
<KlyButton Label="Save" OnClick="SaveAsync" />
@code {
private string? _name;
private bool _notify = true;
private Task SaveAsync() => Task.CompletedTask;
}The popover has no @bind-Open, so .NET is never called when it opens. The save button has an OnClick, so it renders disabled until the
page is interactive; use Href or Type="Button on a button that must work in a static page.
Getting started builds a complete form step by step.
Theming
Map the semantic colors to palettes in AddKlyrooUi. Klyroo.UI computes the fill, the text color and the on-fill color for
light and dark mode and keeps the contrast ratios.
using Klyroo.UI;
builder.Services.AddKlyrooUi(o =>
{
o.Colors.Primary = KlyPalette.Blue;
o.Colors.Neutral = KlyPalette.Zinc;
o.Colors.Add("tertiary", KlyPalette.Indigo);
o.Button.Slot("base", "font-semibold");
});Four levels of customization, from the broadest to the narrowest: the palettes, the --klyroo-* CSS variables, the theme of
each component in AddKlyrooUi, and the Class and Ui parameters of one instance. See the
guides and Concepts.
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
- The .NET 11 SDK. Every package targets
net11.0. - Static server rendering, Interactive Server, WebAssembly and Auto, and a .NET MAUI
BlazorWebView. The components use the native popover API, so a web view needs iOS 17 or Mac Catalyst 17, or an Android System WebView of Chrome 114 or later. Klyroo.,UI Klyroo.andUI. Images Klyroo.declareUI. Server IsAotCompatible: the trimming and AOT analyzers report no warning. No NativeAOT app is published and tested here, andKlyroo.does not declare it.UI. Images. Local - Fonts, icons and Tailwind are resolved by the build, which needs the network once (or a filled cache). Tailwind needs no Node.
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.