TabView.Avalonia.Material3
2.0.0-preview.1
dotnet add package TabView.Avalonia.Material3 --version 2.0.0-preview.1
NuGet\Install-Package TabView.Avalonia.Material3 -Version 2.0.0-preview.1
<PackageReference Include="TabView.Avalonia.Material3" Version="2.0.0-preview.1" />
<PackageVersion Include="TabView.Avalonia.Material3" Version="2.0.0-preview.1" />
<PackageReference Include="TabView.Avalonia.Material3" />
paket add TabView.Avalonia.Material3 --version 2.0.0-preview.1
#r "nuget: TabView.Avalonia.Material3, 2.0.0-preview.1"
#:package TabView.Avalonia.Material3@2.0.0-preview.1
#addin nuget:?package=TabView.Avalonia.Material3&version=2.0.0-preview.1&prerelease
#tool nuget:?package=TabView.Avalonia.Material3&version=2.0.0-preview.1&prerelease
TabView.Avalonia
A brand-new TabsView control that supports dragging and tearing, based on the TabbedPage control in Avalonia 12 and the Tabalonia repository. AOT compatible.
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 | 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
- Avalonia (>= 12.2.999-cibuild0101188-alpha)
- Avalonia.Skia (>= 12.2.999-cibuild0101188-alpha)
- Shirasagi0012.Material3Expressive.Avalonia (>= 0.1.0)
- TabView.Avalonia (>= 2.0.0-preview.1)
-
net11.0
- Avalonia (>= 12.2.999-cibuild0101188-alpha)
- Avalonia.Skia (>= 12.2.999-cibuild0101188-alpha)
- Shirasagi0012.Material3Expressive.Avalonia (>= 0.1.0)
- TabView.Avalonia (>= 2.0.0-preview.1)
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 |