ColorlibHQ.AdminLTE.AspNetCore
0.4.1
dotnet add package ColorlibHQ.AdminLTE.AspNetCore --version 0.4.1
NuGet\Install-Package ColorlibHQ.AdminLTE.AspNetCore -Version 0.4.1
<PackageReference Include="ColorlibHQ.AdminLTE.AspNetCore" Version="0.4.1" />
<PackageVersion Include="ColorlibHQ.AdminLTE.AspNetCore" Version="0.4.1" />
<PackageReference Include="ColorlibHQ.AdminLTE.AspNetCore" />
paket add ColorlibHQ.AdminLTE.AspNetCore --version 0.4.1
#r "nuget: ColorlibHQ.AdminLTE.AspNetCore, 0.4.1"
#:package ColorlibHQ.AdminLTE.AspNetCore@0.4.1
#addin nuget:?package=ColorlibHQ.AdminLTE.AspNetCore&version=0.4.1
#tool nuget:?package=ColorlibHQ.AdminLTE.AspNetCore&version=0.4.1
AdminLTE 4 for ASP.NET Core
Official AdminLTE 4 integration for ASP.NET Core — Blazor components and Tag Helpers for MVC / Razor Pages, built on Bootstrap 5.3 with vanilla JS (no jQuery).
The compiled AdminLTE, Bootstrap and Bootstrap Icons assets ship inside the package as static web assets, so you just dotnet add package and reference them — no npm build step.
Live demo · Documentation · GitHub

Installation
dotnet add package ColorlibHQ.AdminLTE.AspNetCore
Register the services in Program.cs (binds the menu from the "AdminLte" config section):
using ColorlibHQ.AdminLTE.AspNetCore;
builder.Services.AddAdminLte(builder.Configuration);
builder.Services.AddHttpContextAccessor(); // needed for the sidebar Tag Helper's active state
// The menu example below restricts its "Admin" item to a "RequireAdmin" policy.
// Register every policy your menu names, or remove "Policy" from the item: an
// unknown policy throws InvalidOperationException on every page with the sidebar.
builder.Services.AddAuthorization(options =>
options.AddPolicy("RequireAdmin", policy => policy.RequireRole("Admin")));
Define the menu in appsettings.json:
{
"AdminLte": {
"BrandText": "AdminLTE 4",
"SidebarTheme": "dark",
"Menu": [
{ "Header": "MAIN NAVIGATION" },
{ "Text": "Dashboard", "Url": "/", "Icon": "bi bi-speedometer" },
{ "Text": "Admin", "Url": "/admin", "Icon": "bi bi-shield-lock", "Policy": "RequireAdmin" }
]
}
}
Usage — Blazor
Reference the bundled CSS/JS in App.razor and wrap pages in DashboardLayout:
@* App.razor <head> *@
<AdminLteStyles />
@* …at the end of <body>, BEFORE blazor.web.js *@
<AdminLteScripts />
<script src="_framework/blazor.web.js"></script>
Keep <AdminLteScripts /> before blazor.web.js. AdminLTE's menu groups use href="#", which <base href="/"> turns into a link to the home page; Blazor leaves a click alone only if AdminLTE has already handled it, so AdminLTE has to load first. The components also re-run AdminLTE's setup after enhanced navigation and after the first interactive render, so the sidebar overlay, scrollbar and collapsed state survive page changes.
@* MainLayout.razor *@
@inherits LayoutComponentBase
<DashboardLayout>
@Body
</DashboardLayout>
@page "/"
<AppContent Title="Dashboard">
<SmallBox Theme="primary" Title="150" Text="New Orders" Icon="bi-bag-fill" Url="/orders" />
<Card Title="Monthly Recap" Theme="primary" Variant="outline" Collapsible="true">
<Progress Value="80" Theme="success" ShowLabel="true" />
<Button Theme="primary" Icon="bi-download" Label="Export" />
</Card>
</AppContent>
Usage — MVC / Razor Pages
@addTagHelper *, ColorlibHQ.AdminLTE.AspNetCore
<adminlte-styles />
<adminlte-sidebar />
<adminlte-card title="Monthly Recap" theme="primary" variant="outline">
<adminlte-progress value="80" theme="success" show-label="true" />
</adminlte-card>
<adminlte-scripts />
What's included
- Two rendering models from one package — Blazor components (Server & WebAssembly) and Tag Helpers for MVC / Razor Pages.
- All 11 layout components — DashboardLayout, AuthLayout, AppContent, Topbar, Sidebar, SidebarBrand, SidebarNav, SidebarNavItem, SidebarOverlay, Footer, ColorModeToggle, plus the NavMessages, NavNotifications and NavTasks dropdowns.
- Widgets — Card, SmallBox, InfoBox, Alert, Callout, Progress, ProgressGroup, Ratings, Timeline, Breadcrumb, ProfileCard, DescriptionBlock, DirectChat, Tabs and Accordion.
- Form components — Button, Input, Select, Textarea, InputSwitch, all supporting
@bind-ValueinsideEditForm. - Config-driven sidebar menu — a strongly-typed
MenuItemmodel bound fromappsettings.json, with authorization policy/role support and automatic active-item highlighting. - Light / dark / auto colour mode — persisted to
localStorage, with a blocking script so there is no flash of the wrong theme. - Command palette — searches your authorized menu, opens with Cmd/Ctrl+K.
- Bundled static web assets — AdminLTE 4, Bootstrap 5.3.9 and Bootstrap Icons served from
/_content/ColorlibHQ.AdminLTE.AspNetCore/….
Requirements
- .NET 10.0 or later
- ASP.NET Core (Blazor Server/WebAssembly, MVC or Razor Pages)
License
MIT — see LICENSE. The full documentation, component reference and source live on GitHub.
| 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
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Fixes the Blazor glue: AdminLTE's setup now re-runs after the first interactive render and after enhanced navigation (sidebar overlay, scrollbar, collapsed state), and the sidebar closes after navigation on phones. Stylesheets no longer load Bootstrap twice. Sidebar drops role="menu" and marks the current link with aria-current. Bundled AdminLTE 4.10.3.