Fluent UI Blazor v5 — Usage Guide
Skill4.8k starsChanged 4 months agoMITView on GitHub
Provides accurate coding patterns for building Blazor applications with the Microsoft.FluentUI.AspNetCore.Components v5 NuGet package. Covers service registration, theming (CSS-based, no FluentDesignTheme), layout, navigation, dialogs, data grid, forms, icons, and common pitfalls.
Trending
More talk lately.about the whole repository
Who's talking about microsoft/fluentui-blazor
- dotnet/roslyn“CS8669 - #nullable enable does not work in razor files unless in code block”GitHub · May 17, 2023 · 15 reactions
- @baaijte.net“Only 87 stars to go on github.com/microsoft/fl... to get to 4k. Will you help us reach that goal before the …”Bluesky · Dec 4, 2024 · 9 likes
- MicrosoftEdge/WebView2Feedback“[Problem/Bug]: FluentUI ComboBox/Select don't accept selected option in WinUI WebView2”GitHub · May 8, 2024 · 4 reactions
- dotnet/roslyn“Razor tools are crashing in VS 2026”GitHub · Jan 14, 2026 · 2 reactions
- @svrooij.io“FluentUI for #blazor is almost at 4000 stars on GitHub? Can you help in making it to four thousand? …”Bluesky · Dec 4, 2024 · 2 likes
The biggest 5 of 39 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 39
Talked about on GitHub and Bluesky (39 times).
On GitHub · 36
- May 17, 2023CS8669 - #nullable enable does not work in razor files unless in code block — dotnet/roslyn15 reactions · 10 comments
- May 8, 2024[Problem/Bug]: FluentUI ComboBox/Select don't accept selected option in WinUI WebView2 — MicrosoftEdge/WebView2Feedback4 reactions · 3 comments
- Jan 14, 2026Razor tools are crashing in VS 2026 — dotnet/roslyn2 reactions · 24 comments
- May 2, 2024[Feature]: Allow binding to different Cultures for NumberField — microsoft/fluentui2 reactions · 9 comments
- May 17, 2023Document Blazor CSS Isolation Workflows — ni/nimble2 reactions
31 more on GitHub
- Sep 10, 2026fix(web-components): defer fallback custom-state attributes — microsoft/fluentui1 reaction · 4 comments
- Jul 14, 2026Implement all the features defined in PRD and TRD — devkimchi/az-sub-cost-management1 reaction
- Jun 7, 2026chore(deps): Bump the microsoft-platform group with 4 updates — Nerttiyana-Technologies/Stampd1 reaction · 2 comments
- Apr 22, 2026Update dependency Microsoft.FluentUI.AspNetCore.Components to 4.14.2 - autoclosed — archanox/GUNRPG1 reaction
- Mar 11, 2026Update .editorconfig to adjust indent sizes for various file types — Eternet/github1 reaction
- Oct 23, 2025Guidance on integrating build generated files into Static Web Assets — dotnet/AspNetCore.Docs1 reaction · 5 comments
- Aug 16, 2024[Feature]: TreeView Multiselection — microsoft/fluentui1 reaction · 6 comments
- Mar 7, 2024Remove key from overflow item to fix re-rendering — microsoft/aspire1 reaction
- Mar 6, 2024Resource commands menu goes off the bottom of the screen — microsoft/aspire1 reaction · 1 comment
- Jan 10, 2024Prevent use of local functions inside markup — dotnet/aspnetcore1 reaction · 4 comments
- Nov 27, 2023Use tri-state feature in FluentCheckbox — microsoft/aspire1 reaction · 2 comments
- Nov 2, 2023[Bug]: page with a lot of FluentButtons becomes slower and slower (web-components — microsoft/fluentui1 reaction · 3 comments
- Aug 16, 2023feat: add functionality for enabling Virtualized Listbox — microsoft/fast1 reaction · 10 comments
- Oct 5, 2026Bump Microsoft.FluentUI.AspNetCore.Components.Icons from 4.14.4 to 5.0.0 — AlexHedley/poker-recording0 reactions
- Oct 2, 2026Bump Microsoft.FluentUI.AspNetCore.Components from 4.14.4 to 5.0.0 — lfm-org/lfm0 reactions
- Oct 2, 2026Bump the dotnet-minor group with 4 updates — lfm-org/lfm0 reactions
- Oct 2, 2026chore: Bump Microsoft.FluentUI.AspNetCore.Components.Icons from 4.14.4 to 5.0.0 — MW-GC/EventManager0 reactions
- Oct 2, 2026chore: Bump Microsoft.FluentUI.AspNetCore.Components from 4.14.4 to 5.0.0 — MW-GC/EventManager0 reactions
- Oct 1, 2026Bump Microsoft.FluentUI.AspNetCore.Components from 4.14.4 to 5.0.0 — azabluda/InfoCarrier.Core0 reactions
- Oct 1, 2026Bump Microsoft.FluentUI.AspNetCore.Components from 4.14.4 to 5.0.0 — arika0093/BlazorLocalTime0 reactions · 1 comment
- Oct 1, 2026nuget-dressca-cms: Bump the fluentui-packages group with 2 updates — AlesInfiny/maris0 reactions · 1 comment
- Sep 29, 2026Bump Microsoft.FluentUI.AspNetCore.Components from 4.14.4 to 5.0.0 — justinyoo/spn-imda0 reactions
- Sep 28, 2026Bump Microsoft.FluentUI.AspNetCore.Components.Emoji from 4.14.4 to 5.0.0 — AlexHedley/Utility-Blazor0 reactions
- Sep 28, 2026Bump Microsoft.FluentUI.AspNetCore.Components from 4.14.4 to 5.0.0 — AlexHedley/Utility-Blazor0 reactions
- Sep 28, 2026Bump Microsoft.FluentUI.AspNetCore.Components and Microsoft.FluentUI.AspNetCore.Components.Icons — AliceNovel/AquaNotes0 reactions
- Aug 24, 2026chore(deps): Bump the microsoft-platform group with 19 updates — Nerttiyana-Technologies/Stampd0 reactions · 1 comment
- Jul 15, 2026Bump the web group with 5 updates — CorruptComputer/BlazorWasmOsmOauth0 reactions · 1 comment
- Jun 29, 2026Bump the microsoft-fluentui group with 2 updates — twsouthwick/obsidian-livesync-manager0 reactions
- May 28, 2026Bump Microsoft.FluentUI.AspNetCore.Components and Microsoft.FluentUI.AspNetCore.Components.Icons — Ozymandros/Godot-Generator0 reactions
- Jan 18, 2026Bump the nuget-dependencies group with 4 updates — macel94/blazorazdocustomextsample0 reactions
- Dec 10, 2024IL trimming support — havit/Havit.Blazor0 reactions · 1 comment
On Bluesky · 3
- Dec 4, 2024Only 87 stars to go on github.com/microsoft/fl... to get to 4k. Will you help us reach that goal before the end of the year? — @baaijte.net9 likes and reposts · 1 reply
- Dec 4, 2024FluentUI for #blazor is almost at 4000 stars on GitHub? Can you help in making it to four thousand? github.com/microsoft/fl... Just press… — @svrooij.io2 likes and reposts
- Nov 19, 2023📦 microsoft / fluentui-blazor ⭐ 1,950 (+12) 🗒 C# Microsoft Fluent UI Blazor components library. For use with .NET 6.0 or higher Blazor… — @github-trending.bsky.social2 likes and reposts
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- csharp-naming-conventionsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 104
All Fluent design tokens are available as CSS custom properties: var(--colorBrandBackground), var(--colorNeutralForeground1), …
- Very specific: line 321
All list-based components (FluentSelect, FluentCombobox, FluentListbox) now take two type parameters: TOption (the item type) and TValue …
- Very specific: line 379
Every component supports Margin and Padding parameters using a spacing-utility syntax:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fluent UI Blazor v5 — Usage Skill
This skill helps AI assistants generate correct, idiomatic code for
applications that consume the Microsoft.FluentUI.AspNetCore.Components
v5 NuGet package. v5 targets .NET 9+ and wraps
@fluentui/web-components v3.
Critical: v5 is a major rewrite. Many v4 APIs are removed or renamed. Always verify patterns against this skill before answering.
Quick Setup Checklist
// Program.cs
builder.Services.AddFluentUIComponents();@* App.razor / MainLayout.razor — add providers once at root *@
<FluentProviders /><!-- index.html / _Host.cshtml — required CSS & JS -->
<link href="_content/Microsoft.FluentUI.AspNetCore.Components/css/default-fuib.css"
rel="stylesheet" />The <FluentProviders /> component replaces the need to manually add
<FluentDialogProvider />, <FluentTooltipProvider />, and
<FluentKeyCodeProvider /> separately.
Key v5 Differences from v4
| Area | v4 | v5 |
| Target framework | net8.0 | net9.0 / net10.0 |
| Theming | <FluentDesignTheme> component | CSS custom properties via JS (setTheme), body[data-theme] attribute |
| Toast / MessageBar | IToastService, IMessageService | Removed — use FluentToast component directly or custom solution |
| Navigation | FluentNavMenu, FluentNavLink, FluentNavGroup | FluentNav, FluentNavItem, FluentNavCategory, FluentNavSectionHeader |
| Dialog API | IDialogContentComponent<T>, complex reference | Simplified: IDialogService.ShowDialogAsync<TDialog>(DialogOptions) |
| List binding | FluentListBase<TOption>, SelectedOptions | FluentListBase<TOption, TValue>, SelectedItems |
| Progress | FluentProgress | FluentProgressBar (FluentProgress = obsolete shim) |
| Appearance enum | Appearance.Accent, .Stealth, etc. | ButtonAppearance.Primary, .Transparent, etc. |
| Switch | CheckedMessage/UncheckedMessage child content | Removed — label only via Label parameter |
| Component base | Property injection | Constructor injection of LibraryConfiguration |
| Margin / Padding | Not on components | Available on every component via Margin and Padding parameters |
| Icons packages | Separate NuGet packages | Bundled (core icons), with optional extended packages |
Theming
v5 replaces <FluentDesignTheme> with a JavaScript + CSS custom property model.
Apply a theme
@inject IJSRuntime JSRuntime
<FluentButton OnClick="@SwitchTheme">Toggle theme</FluentButton>
@code {
private async Task SwitchTheme()
{
await JSRuntime.InvokeVoidAsync("Blazor.theme.switchTheme");
}
}Detect current mode
// body[data-theme="dark"] → dark mode
// body without data-theme → light mode
Blazor.theme.isDarkMode() // returns boolean
Blazor.theme.isSystemDark() // returns booleanConditional rendering by theme
<FluentIcon Class="hidden-if-light"
Value="@(new Icons.Filled.Size20.WeatherSunny())" />
<FluentIcon Class="hidden-if-dark"
Value="@(new Icons.Filled.Size20.WeatherMoon())" />CSS variables
All Fluent design tokens are available as CSS custom properties:
var(--colorBrandBackground), var(--colorNeutralForeground1),
var(--fontSizeBase300), var(--borderRadiusMedium), etc.
C# constants are available via StylesVariables and SystemColors:
// In component styles
style="@($"background: {SystemColors.Neutral.Background1}")"
// Equivalent to: background: var(--colorNeutralBackground1);
style="@($"border-radius: {StylesVariables.Borders.Radius.Medium}")"
// Equivalent to: border-radius: var(--borderRadiusMedium);Layout & Navigation
FluentLayout
<FluentLayout>
<FluentLayoutItem Area="LayoutArea.Header">
<FluentLayoutHamburger />
<span>My App</span>
</FluentLayoutItem>
<FluentLayoutItem Area="LayoutArea.Menu">
<FluentNav>
<FluentNavItem Href="/" Icon="@(new Icons.Regular.Size20.Home())">
Home
</FluentNavItem>
<FluentNavCategory Label="Settings" Icon="@(new Icons.Regular.Size20.Settings())">
<FluentNavItem Href="/settings/profile">Profile</FluentNavItem>
<FluentNavItem Href="/settings/account">Account</FluentNavItem>
</FluentNavCategory>
<FluentNavSectionHeader Label="Admin" />
<FluentNavItem Href="/admin">Dashboard</FluentNavItem>
</FluentNav>
</FluentLayoutItem>
<FluentLayoutItem Area="LayoutArea.Content">
@Body
</FluentLayoutItem>
<FluentLayoutItem Area="LayoutArea.Footer">
<span>© 2025</span>
</FluentLayoutItem>
</FluentLayout>Common mistake: Using
FluentNavMenu/FluentNavLink/FluentNavGroup(v4 names). These do not exist in v5.
Dialogs
Show a simple dialog
@inject IDialogService DialogService
private async Task OpenDialog()
{
var options = new DialogOptions
{
Header = { Title = "Confirm action" },
Size = DialogSize.Medium,
Modal = true,
};
var result = await DialogService.ShowDialogAsync<ConfirmDialog>(options);
if (!result.Cancelled)
{
// result.Value contains the returned data
}
}Dialog component
@* ConfirmDialog.razor *@
<p>Are you sure you want to proceed?</p>
<FluentButton Appearance="ButtonAppearance.Primary"
OnClick="@Confirm">Yes</FluentButton>
<FluentButton OnClick="@Cancel">No</FluentButton>
@code {
[CascadingParameter]
public IDialogInstance Dialog { get; set; } = default!;
private async Task Confirm()
=> await Dialog.CloseAsync(DialogResult.Ok(true));
private async Task Cancel()
=> await Dialog.CloseAsync(DialogResult.Cancel());
}Show a drawer
var result = await DialogService.ShowDrawerAsync<DrawerContent>(options =>
{
options.Header.Title = "Settings";
options.Alignment = DialogAlignment.End;
options.Size = DialogSize.Small;
});Pass parameters to the dialog component
var options = new DialogOptions
{
Header = { Title = "Edit item" },
Parameters = new Dictionary<string, object?>
{
["ItemId"] = selectedItemId,
["ItemName"] = selectedItemName,
},
};
await DialogService.ShowDialogAsync<EditDialog>(options);Common mistake: Implementing
IDialogContentComponent<T>(v4 pattern). In v5, dialog components are plain Razor components that receiveIDialogInstanceas a cascading parameter.
Data Grid
<FluentDataGrid Items="@people" Pagination="@pagination">
<PropertyColumn Property="@(p => p.Name)" Sortable="true" />
<PropertyColumn Property="@(p => p.Email)" />
<TemplateColumn Title="Actions">
<FluentButton Size="ButtonSize.Small"
OnClick="@(() => Edit(context))">
Edit
</FluentButton>
</TemplateColumn>
</FluentDataGrid>
<FluentPaginator State="@pagination" />
@code {
private IQueryable<Person> people = GetPeople().AsQueryable();
private PaginationState pagination = new() { ItemsPerPage = 10 };
}Remote data with ItemsProvider
<FluentDataGrid ItemsProvider="@dataProvider" Virtualize="true" ItemSize="46">
<PropertyColumn Property="@(p => p.Name)" Sortable="true" />
</FluentDataGrid>
@code {
private GridItemsProvider<Person> dataProvider = default!;
protected override void OnInitialized()
{
dataProvider = async request =>
{
var result = await Http.GetFromJsonAsync<PagedResult<Person>>(
$"api/people?start={request.StartIndex}&count={request.Count}");
return GridItemsProviderResult.From(result!.Items, result.TotalCount);
};
}
}See DATAGRID.md for advanced patterns (EF adapter, OData, column options, resize, custom sort).
Forms & Input Components
v5 input components extend InputBase<TValue> and implement IFluentField,
providing built-in form validation integration.
<EditForm Model="@model" OnValidSubmit="@Submit">
<DataAnnotationsValidator />
<FluentTextField @bind-Value="model.Name"
Label="Name"
Required="true" />
<FluentNumberField @bind-Value="model.Age"
Label="Age"
Min="0" Max="150" />
<FluentSelect TOption="string"
TValue="string"
Items="@countries"
@bind-Value="model.Country"
OptionText="@(c => c)"
OptionValue="@(c => c)"
Label="Country" />
<FluentCheckbox @bind-Value="model.AcceptTerms"
Label="I accept the terms" />
<FluentButton Type="ButtonType.Submit"
Appearance="ButtonAppearance.Primary">
Submit
</FluentButton>
</EditForm>List components — two type parameters
All list-based components (FluentSelect, FluentCombobox, FluentListbox)
now take two type parameters: TOption (the item type) and TValue (the
bound value type).
<FluentSelect TOption="Country"
TValue="int"
Items="@countries"
@bind-Value="model.CountryId"
OptionText="@(c => c.Name)"
OptionValue="@(c => c.Id)"
Label="Country" />
@* Multiple selection *@
<FluentListbox TOption="string"
TValue="string"
Items="@tags"
Multiple="true"
SelectedItems="@selectedTags"
SelectedItemsChanged="@(items => selectedTags = items)"
OptionText="@(t => t)"
OptionValue="@(t => t)" />Common mistake: Using
SelectedOptionsorSelectedOptionsChanged(v4 names). In v5, useSelectedItems/SelectedItemsChanged.
Icons
Icons are instantiated as objects and passed via Value, IconStart, or
IconEnd parameters:
@* Standalone icon *@
<FluentIcon Value="@(new Icons.Regular.Size24.Add())" />
@* Icon with color *@
<FluentIcon Value="@(new Icons.Filled.Size20.Heart().WithColor("red"))" />
@* Icon in a button *@
<FluentButton IconStart="@(new Icons.Regular.Size20.Add())"
Appearance="ButtonAppearance.Primary">
Add item
</FluentButton>
@* Icon from image URL *@
<FluentIcon Value="@Icon.FromImageUrl("/images/logo.png")" />Icon naming: Icons.{Variant}.{Size}.{Name}
- Variants:
Regular,Filled - Sizes:
Size16,Size20,Size24,Size28,Size32,Size48
Margin & Padding (NEW in v5)
Every component supports Margin and Padding parameters using a
spacing-utility syntax:
<FluentCard Margin="Margin.All4" Padding="Padding.Horizontal3 Padding.Vertical2">
Content with spacing
</FluentCard>Common Pitfalls
- Missing
<FluentProviders />— Dialogs, tooltips, and keyboard shortcuts will silently fail without this component in your layout. - Using v4 component names —
FluentNavMenu→FluentNav,FluentProgress→FluentProgressBar,FluentDesignTheme→ removed. - Using
IToastService— Toast service does not exist in v5. SelectedOptionson lists — Renamed toSelectedItems.- Single type parameter on lists —
FluentSelect<string>is v4. v5 requiresFluentSelect<TOption, TValue>. Appearance.Accent— UseButtonAppearance.Primaryinstead.- Targeting net8.0 — v5 requires net9.0 or later.
- Implementing
IDialogContentComponent— Not needed in v5. Dialog components are plain Razor components receivingIDialogInstanceas a cascading parameter.
Reference Files
- SETUP.md — Full setup guide for Blazor Server, WebAssembly, and Auto modes
- DATAGRID.md — Advanced data grid patterns
- THEMING.md — Detailed theming, design tokens, and CSS variables reference
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

