TabView.Avalonia.Material3 2.0.0-preview.1

This is a prerelease version of TabView.Avalonia.Material3.
dotnet add package TabView.Avalonia.Material3 --version 2.0.0-preview.1
                    
NuGet\Install-Package TabView.Avalonia.Material3 -Version 2.0.0-preview.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="TabView.Avalonia.Material3" Version="2.0.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TabView.Avalonia.Material3" Version="2.0.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="TabView.Avalonia.Material3" />
                    
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 TabView.Avalonia.Material3 --version 2.0.0-preview.1
                    
#r "nuget: TabView.Avalonia.Material3, 2.0.0-preview.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 TabView.Avalonia.Material3@2.0.0-preview.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=TabView.Avalonia.Material3&version=2.0.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=TabView.Avalonia.Material3&version=2.0.0-preview.1&prerelease
                    
Install as a Cake Tool

TabView.Avalonia

NuGet

A brand-new TabsView control that supports dragging and tearing, based on the TabbedPage control in Avalonia 12 and the Tabalonia repository. AOT compatible.

sample

Usage

Install the package from NuGet:

Install-Package TabView.Avalonia -Version 2.0.0-preview.1
# Or 'dotnet add package TabView.Avalonia --version 2.0.0-preview.1'

Add the Style to your App.axaml:

<Application xmlns:tabView="using:TabView.Avalonia">
    ...
    <Application.Styles>
        <FluentTheme />
        <tabView:TabsViewFluentTheme />
    </Application.Styles>
</Application>

The original TabsViewTheme is now named TabsViewFluentTheme. The two themes are independent: their entry points, resources and templates live in Themes/Fluent/ and Themes/Fluent2/ respectively. Include one pair of themes.

For Fluent 2 / WinUI 3 styling, reference Avalonia.Themes.Fluent2 and use:

<Application.Styles>
    <Fluent2Theme />
    <tabView:TabsViewFluent2Theme />
</Application.Styles>

This preview pins Avalonia to 12.2.999-cibuild0101188-alpha in Directory.Build.props, with the official nightly feed in NuGet.Config. All Avalonia packages must use the same version. Fluent 2 comes from Avalonia PR #21771. The tab template follows the WinUI 3 TabView XAML, its resource dictionary and selected-tab geometry in TabViewItem.cpp.

Both packages target .NET 10 and .NET 11. Building this repository requires the .NET 11 SDK pinned in global.json. The .NET 11 target enables Runtime Async V2 with <Features>runtime-async=on</Features>; the .NET 10 target uses the usual compiler-generated async state machines.

Run the demo with dotnet run --project src/TabView.Avalonia.Demo --framework net11.0. Use --framework net10.0 to try the .NET 10 build. The tab-strip picker switches between Fluent, Fluent 2 and Material 3 while preserving pages, selection and light/dark mode, including torn-off windows. The moon/sun button switches light/dark mode. -- --fluent1 starts with the original theme; -- --material3 starts with Material 3.

Fluent 2 dimensions and brushes use the TabsViewFluent2 resource prefix, for example TabsViewFluent2ItemHeight, TabsViewFluent2ItemWidth, TabsViewFluent2ItemCornerRadius and TabsViewFluent2ContentBackground. Override them in application resources; colors default to Fluent 2 semantic tokens and follow the current theme variant. The tab strip currently uses the control's horizontal layout and shrinks tabs to fit, as in the original theme. The selected tab joins the content surface without WinUI's horizontal divider. Add and close actions use vector paths with one-DIP strokes and no dependency on system icon fonts or FluentIcons. TabsViewFluent2ButtonGlyphSize sets the plus size; TabsViewFluent2CloseButtonGlyphSize gives the diagonal close mark a smaller optical size. The plus uses integer path edges for crisp strokes at 100%. Pixel regression tests cover the join in light/dark mode at 100%, 125%, 150% and 200%. Run all checks with dotnet test TabView.Avalonia.slnx.

The Material 3 preview is isolated in src/TabView.Avalonia.Material3/, with its own Themes/Material3/ templates and a dependency on Shirasagi0012.Material3Expressive.Avalonia 0.1.0. The core library and Fluent themes do not depend on Material3Expressive or its Skia 4 stack. Install TabView.Avalonia.Material3 version 2.0.0-preview.1 from NuGet and load its theme after MaterialTheme:

<Application
    xmlns="https://github.com/avaloniaui"
    xmlns:material="clr-namespace:Material3Expressive.Styles;assembly=Material3Expressive"
    xmlns:materialTabs="clr-namespace:TabView.Avalonia;assembly=TabView.Avalonia.Material3">
    <Application.Styles>
        <FluentTheme />
        <material:MaterialTheme />
        <materialTabs:TabsViewMaterial3Theme />
    </Application.Styles>
</Application>

Follow Material3Expressive's initialization: call UseRoundedSymbols() on the AppBuilder and ComposeAnimation.AnimationScope.Initialize(this) before loading each window's XAML. The Demo also uses the optional Roboto package and WithRobotoFont(). Keep the managed/native Skia versions supplied by MaterialSymbols together.

Material document tabs follow Chrome's connected selected-tab shape: rounded top corners, concave feet, shared selected/content color, quiet inactive separators, and round close/add state layers. Hovering an inactive tab highlights its rounded body and hides both adjacent dividers; the selected tab keeps its background. The 20 DIP close feedback sits inside a 28 DIP hit target, while add feedback is 32 DIP. Close buttons have a reserved area above 75 DIP tab width. At or below 75 DIP only the selected tab keeps its close button, with the header yielding space to it. CloseButtonVisibilityThreshold controls this boundary; fixed tabs and the global close-button setting still apply. All three themes share TabHeaderPanel for this rule, content clipping and close-button placement. Tab headers retain pointer capture outside their bounds so dragging, tearing out and merging use the same implementation as the Fluent themes. Material clickable feedback is limited to the add/close buttons; header feedback uses hover/focus styles. This is a document-tab adaptation rather than the indicator-based navigation tabs in the Material specification. Compare Chromium's horizontal tab styling and Material3Expressive's TabRow for the two purposes.

All Material tab colors, dimensions and typography resolve through {m3:Token}. TabsViewMaterial3TokenSource maps the public TabsViewMaterial3Tokens key instances to component defaults and TokenRef values. The default top radius references MaterialTokens.Sys.Shape.Medium (12 DIP), with a 12 DIP foot. Selection and content share ContentColor; light/dark variants resolve to Material surface roles. Override these keys with an ITokenSource inside MaterialResource, at application or control scope. System color/shape/type overrides and live palette changes resolve through the references at the consuming control. Tests cover this resolution, three-theme roundtrips, pointer feedback, and connected edges and circular feet with 4, 12 and 28 tabs at 100%, 125%, 150% and 200% scaling.

And use the control just like TabbedPage:

<tabView:TabsView>
    <ContentPage Header="Tab 1" />
    <ContentPage Header="Tab 2" />
    <ContentPage Header="Tab 3" />
</tabView:TabsView>

But if you want to support AOT, you need to override the TabsView.InterTabController property and implement the IInterTabClient interface, like this:

MyTabsView.InterTabController = new InterTabController { InterTabClient = new AotInterTabClient() };

private sealed class AotInterTabClient : IInterTabClient
{
    public TabsHost GetNewHost(InterTabController controller, TabsHost host)
    {
        var window = new MainWindow { Owner = host.Window };
        return new TabsHost(window, window.MyTabsView);
    }
}

To disable tearing, you can set the TabsView.InterTabController property to null:

MyTabsView.InterTabController = null;

Build and publish

dotnet test TabView.Avalonia.slnx -c Release builds and tests both target frameworks. dotnet pack TabView.Avalonia.slnx -c Release creates the core and Material 3 NuGet packages in output/. The demo and tests are not packed.

The Publish NuGet GitHub Actions workflow tests and packs a release, then publishes both packages. Configure NuGet.org Trusted Publishing for user Poker, repository Poker-sang/TabView.Avalonia, and workflow publish-nuget.yml. Alternatively, set the repository secret NUGET_API_KEY with permission to publish both package IDs. Run the workflow manually from the release tag after the authentication is configured. The built packages are also retained as workflow artifacts.

Dependencies are updated to the latest compatible versions. xUnit stays at 3.2.2 because Avalonia.Headless.XUnit's discoverers are not compatible with xUnit 4 yet.

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
2.0.0-preview.1 64 11/11/2026