BlazorXTabs 5.0.1
dotnet add package BlazorXTabs --version 5.0.1
NuGet\Install-Package BlazorXTabs -Version 5.0.1
<PackageReference Include="BlazorXTabs" Version="5.0.1" />
<PackageVersion Include="BlazorXTabs" Version="5.0.1" />
<PackageReference Include="BlazorXTabs" />
paket add BlazorXTabs --version 5.0.1
#r "nuget: BlazorXTabs, 5.0.1"
#:package BlazorXTabs@5.0.1
#addin nuget:?package=BlazorXTabs&version=5.0.1
#tool nuget:?package=BlazorXTabs&version=5.0.1
BlazorXTabs
An extended tabs component library providing various tab features for Blazor!
Checkout all the examples at: BlazorXTabs Demo
Main Features:
- Close tabs
- Navigate to page and render it as a tab
- Tabs won't duplicate when navigating to the same page
- Use XTabs classes to further customize the look
- Keep tabs state when switching between tabs
- Bind to events: Selected / Changed / Removed
- v1.2.0
- Setup wizard like tabs with events: Previous / Next and customizable previous/next buttons
- Possibility to set the active tab to Loading
- v1.3.0
- Able to drag & drop tabs
- v1.4.0
- Able to replace the standard RouteView component with a XTabsRouteView component that automatically renders the pages as tabs
- v1.5.0
- When CloseTabs is enabled. Able to close all tabs and configure a threshold to display the close all tabs button.
- When CloseTabs is enabled. Able to use mouse middle button click to close the tab.
- When CloseTabs is enabled. Able to limit closeable tabs to 1.
- v1.6.0
- Fixed RenderMode.Partial duplicating tabs
- Introduced XTabsAuthorizeRouteView to allow tabs integration with Authentication
- v1.7.0
- NET6 Support
- v1.8.0
- NET7 Support
- v1.9.0
- Introduced NavigationMode, this is a XTabsRouteView only setting.
- NavigationMode.Standard : This is the default and XTabs will work as it always did. Clicking a Page Tab will set it as active.
- NavigationMode.Navigable : This new setting will make it so that whenever a Page Tab is set to active, it additionally triggers navigation. This is usefull to sync the browser url to the currently active Page Tab.
- Introduced NavigationMode, this is a XTabsRouteView only setting.
- v2.0.0
- NET8 Support
- v3.0.0
- NET9 Support
- v3.0.1
- Fix SetTitle Method to properly set the title without overriding inherent id and automatically refresh tabs
- v4.0.0
- Drop support for .NET6 and .NET7
- NET10 Support
- v4.0.1
- Fixed default css for close button hiding in bootstrap 5
- v5.0.0
- Drop support for .NET8 and .NET9
- NET11 Support
- Breaking: XTabs styles are no longer shipped as scoped CSS (
{YOUR-PROJECT-NAME}.styles.css). They now live in a standalone stylesheet,_content/BlazorXTabs/blazorxtabs.css, that you reference explicitly (or leave out to use your own styles) - Styles are customizable through
--xtabs-*CSS variables - Optional Bootstrap 5 theme,
_content/BlazorXTabs/blazorxtabs.bootstrap.css, that follows Bootstrap's light/dark color modes - Content Security Policy (CSP) friendly: tab headers no longer use inline event handlers, so drag & drop works under a strict
script-src - The
XTabsStyleparameter is kept. It renders an inlinestyleattribute, so under a strictstyle-srcuseCssClassand the--xtabs-*variables instead (see Content Security Policy)
- v5.0.1
- Fixed closing the last tab (e.g. the Home tab) when
NoTabsNavigatesToHomepageis enabled: the homepage tab now reopens right away instead of staying hidden and reappearing later when another page is opened
- Fixed closing the last tab (e.g. the Home tab) when
Examples:
Standard usage:
<XTabs>
<XTab Title="Tab1">
Content 1
</XTab>
<XTab Title="Tab2">
Content 2
</XTab>
</XTabs>
Using the XTabsRouteView or XTabsAuthorizeRouteView to render pages as tabs:
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<XTabsRouteView CloseTabs="true" NewTabSetActive="true"
NavigationMode="BlazorXTabs.Configuration.NavigationMode.Navigable"
RenderMode="BlazorXTabs.Configuration.RenderMode.Full"
RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
Use the XTabPageAttribute to set the page's tab title & other relevant parameters
@attribute [XTabPageAttribute("Home")]
Using as a wizard:
<XTab Title="Steps example">
<XTabs RenderMode="BlazorXTabs.Configuration.RenderMode.Steps">
<XTab Title="Step1">
This is step 1!
</XTab>
<XTab Title="Step2">
This is step 2!
</XTab>
<XTab Title="Step3">
This is the last step. Step 3!
</XTab>
</XTabs>
</XTab>
Drag&Drop:
<XTab Title="Drag Example">
<XTabs IsDraggable="true" RenderMode="BlazorXTabs.Configuration.RenderMode.Partial" >
<XTab Title="1. I can be dragged!!">
<p>I can be dragged!!</p>
</XTab>
<XTab Title="2. Drag me!">
<p>Drag me!</p>
</XTab>
<XTab Title="3. Please drag me!! I hate being last place!">
<p>Please drag me!! I hate being last place!</p>
</XTab>
</XTabs>
</XTab>
Setup:
- You can install the package via the nuget package manager just search for BlazorXTabs. You can also install via powershell using the following command.
Install-Package BlazorXTabs
- Or via the dotnet CLI.
dotnet add package BlazorXTabs
- If you'd like to bring in XTabs default styling, add the stylesheet to your
App.razor/index.html/_Host.cshtml:
<link href="_content/BlazorXTabs/blazorxtabs.css" rel="stylesheet" />
or, with static asset fingerprinting:
<link href="@Assets["_content/BlazorXTabs/blazorxtabs.css"]" rel="stylesheet" />
- Optionally, add the Bootstrap 5 theme after it so XTabs follows Bootstrap's colors and light/dark mode:
<link href="_content/BlazorXTabs/blazorxtabs.bootstrap.css" rel="stylesheet" />
- Customize the look by overriding the CSS variables, for example:
:root {
--xtabs-bg: transparent;
--xtabs-link-active-bg: var(--bs-secondary);
}
Available variables: --xtabs-bg, --xtabs-border-color, --xtabs-border-radius, --xtabs-header-bg, --xtabs-header-padding, --xtabs-content-padding, --xtabs-link-color, --xtabs-link-padding, --xtabs-link-active-bg, --xtabs-link-active-border-color, --xtabs-drop-border, --xtabs-close-color, --xtabs-close-text-shadow, --xtabs-close-opacity, --xtabs-close-all-color.
- Don't want the default styling at all? Just don't reference the stylesheet and style the
xtabs-*classes yourself.
Upgrading from v4
XTabs styles used to come in through {YOUR-PROJECT-NAME}.styles.css. From v5 you must add <link href="_content/BlazorXTabs/blazorxtabs.css" rel="stylesheet" /> to keep the default look.
Content Security Policy (CSP)
XTabs renders no inline scripts or inline event handlers, so it works with a strict script-src policy (e.g. script-src 'self', plus whatever your Blazor hosting model already requires, such as 'wasm-unsafe-eval' for WebAssembly).
The default styling ships as a stylesheet, so it works with style-src 'self'. The one exception is the XTabs Style parameter: it renders an inline style attribute, which a strict style-src without 'unsafe-inline' will block. Under such a policy, use CssClass and the --xtabs-* CSS variables from your own stylesheet instead of Style.
| 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. net11.0 is compatible. |
-
net10.0
- Microsoft.AspNetCore.Components.Authorization (>= 10.0.0)
- Microsoft.AspNetCore.Components.Web (>= 10.0.0)
-
net11.0
- Microsoft.AspNetCore.Components.Authorization (>= 11.0.0)
- Microsoft.AspNetCore.Components.Web (>= 11.0.0)
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 | |
|---|---|---|---|
| 5.0.1 | 78 | 12/2/2026 | |
| 5.0.0 | 118 | 11/26/2026 | |
| 4.0.1 | 1,552 | 5/12/2026 | |
| 4.0.0 | 1,903 | 11/12/2025 | |
| 3.0.1 | 3,895 | 12/30/2024 | |
| 3.0.1-preview-1 | 203 | 12/10/2024 | |
| 3.0.0 | 233 | 11/26/2024 | |
| 2.0.0 | 4,239 | 11/15/2023 | |
| 1.9.0 | 1,032 | 3/22/2023 | |
| 1.8.1 | 580 | 12/4/2022 | |
| 1.8.1-rc | 358 | 10/19/2022 | |
| 1.8.0-rc | 415 | 8/24/2022 | |
| 1.7.0 | 1,727 | 11/9/2021 | |
| 1.6.2 | 564 | 11/5/2021 | |
| 1.6.1 | 739 | 11/5/2021 | |
| 1.6.0 | 600 | 8/22/2021 | |
| 1.5.2 | 609 | 4/24/2021 | |
| 1.5.1 | 636 | 3/8/2021 | |
| 1.5.0 | 591 | 2/14/2021 | |
| 1.4.2 | 601 | 2/9/2021 |