BlazorXTabs 5.0.1

dotnet add package BlazorXTabs --version 5.0.1
                    
NuGet\Install-Package BlazorXTabs -Version 5.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BlazorXTabs" Version="5.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlazorXTabs" Version="5.0.1" />
                    
Directory.Packages.props
<PackageReference Include="BlazorXTabs" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BlazorXTabs --version 5.0.1
                    
#r "nuget: BlazorXTabs, 5.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BlazorXTabs@5.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BlazorXTabs&version=5.0.1
                    
Install as a Cake Addin
#tool nuget:?package=BlazorXTabs&version=5.0.1
                    
Install as a Cake Tool

BlazorXTabs

An extended tabs component library providing various tab features for Blazor!

GitHub tag (latest SemVer) NuGet Nuget MIT

Screenshot of sample 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.
  • 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 XTabs Style parameter is kept. It renders an inline style attribute, so under a strict style-src use CssClass and the --xtabs-* variables instead (see Content Security Policy)
  • v5.0.1
    • Fixed closing the last tab (e.g. the Home tab) when NoTabsNavigatesToHomepage is enabled: the homepage tab now reopens right away instead of staying hidden and reappearing later when another page is opened

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1 is deprecated because it is no longer maintained.
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
Loading failed