MiniToolbar.Avalonia 2.1.0.138

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

MiniToolbar.Avalonia

Toolbar controls for Avalonia 12.1.6+ / .NET 10 applications. Build horizontal or vertical toolbars with buttons, labels, separators, combo boxes, checkboxes, toggles, menus, text and numeric inputs, and sliders. Normal mode shows icons and labels; compact mode hides labels when an icon is present and preserves text-only actions.

Quick start

dotnet add package MiniToolbar.Avalonia

Register the styles after your application theme in App.axaml:

<Application xmlns="https://github.com/avaloniaui"
             xmlns:toolbar="clr-namespace:MiniToolbar.Avalonia.Themes;assembly=MiniToolbar.Avalonia">
    <Application.Styles>
        <FluentTheme />
        <toolbar:MiniToolbarStyles />
    </Application.Styles>
</Application>

Basic usage

<toolbar:Toolbar xmlns="https://github.com/avaloniaui"
                 xmlns:toolbar="clr-namespace:MiniToolbar.Avalonia;assembly=MiniToolbar.Avalonia">
    <toolbar:ToolbarButton Text="Open" Icon="avares://MyApp/Assets/Open.png"
                           ToolTip.Tip="Open a document" Command="{Binding OpenCommand}" />
    <toolbar:ToolbarSeparator />
    <toolbar:ToolbarLabel Content="View" />
    <toolbar:ToolbarComboBox SelectedIndex="0">
        <ComboBoxItem Content="Design" />
        <ComboBoxItem Content="Preview" />
    </toolbar:ToolbarComboBox>
    <toolbar:ToolbarCheckBox Content="Snap" IsChecked="True" />
</toolbar:Toolbar>

Replace MyApp with your assembly name and bind OpenCommand to your view model. With compiled bindings enabled, declare the containing view's x:DataType. The standard Click event is also supported.

Include image files in your application project:

<ItemGroup>
    <AvaloniaResource Include="Assets\Open.png" />
</ItemGroup>

Icons and layout

  • Toolbar.Orientation: Horizontal (default) or Vertical.
  • Toolbar.DisplayMode: Normal (default) or Compact.
  • ToolbarButton.Icon: an absolute avares:// image path, Bitmap/IImage, or a control such as PathIcon. Bound string paths are supported.
  • ToolbarButton.Text: the label and default accessible name. When empty, inherited Content/ContentTemplate supplies the button content.
  • Image sources use ToolbarButtonImageSize (24 by default); size control icons yourself.
  • Commands, command parameters, click events, keyboard activation, disabled states, padding, and corner radius use standard button APIs. Add tooltips for compact actions.

Material Icons is optional and only used by the demo.

Additional controls

  • ToolbarToggleButton: native IsChecked and command support for on/off actions.
  • ToolbarDropDownButton: opens a Flyout or MenuFlyout.
  • ToolbarSplitButton: a primary command and a separate arrow that opens its flyout.
  • ToolbarTextBox: editable search/filter text with PlaceholderText.
  • ToolbarNumericUpDown: numeric values with minimum, maximum, and increment.
  • ToolbarSlider: continuous values such as opacity or zoom.
  • ToolbarItemHost: wraps arbitrary controls, including progress indicators or status badges.

These inherit the native Avalonia APIs and implement IToolbarItem. Toggle/dropdown/split buttons use Content for text or icons; their content stays visible in compact mode. Use ToolbarButton for the Icon/Text presentation that hides labels in compact mode.

<toolbar:Toolbar DisplayMode="Compact">
    <toolbar:ToolbarToggleButton Content="B" FontWeight="Bold" IsChecked="True"
                                 AutomationProperties.Name="Bold" />
    <toolbar:ToolbarTextBox PlaceholderText="Search…" AutomationProperties.Name="Search" />
    <toolbar:ToolbarNumericUpDown Minimum="1" Maximum="100" Value="12"
                                 AutomationProperties.Name="Font size" />
    <toolbar:ToolbarSlider Minimum="0" Maximum="100" Value="60"
                          AutomationProperties.Name="Opacity" />
</toolbar:Toolbar>

Text and numeric inputs use ToolbarInputNormalHeight / ToolbarInputCompactHeight (32 / 28). Width resources are ToolbarTextBoxMinWidth (140), ToolbarNumericUpDownMinWidth (90), and ToolbarSliderMinWidth (100). Vertical sliders use ToolbarSliderMinHeight (100). Set widths to fit the available space; the toolbar does not wrap or provide overflow.

Dynamic toolbars

using System.Collections.ObjectModel;
using MiniToolbar.Avalonia;

var items = new ObservableCollection<IToolbarItem>
{
    new ToolbarButton { Text = "Open" },
    new ToolbarSeparator(),
    new ToolbarCheckBox { Content = "Snap" }
};
var toolbar = new Toolbar { ItemsSource = items };
items.Add(new ToolbarButton { Text = "Publish" });

Alternatively, add controls to Toolbar.Items directly. ItemsSource mirrors into Items; observable add/remove/replace/move/reset changes preserve unchanged controls. Mutate the source on the UI thread. Items are distinct control instances implementing IToolbarItem, not data models, and each control can belong to only one toolbar at a time.

Themes and sizing

Built-in styles support light and dark themes. Override resources in application or container scope: ToolbarBackgroundColor, ToolbarTextColor, ToolbarBackgroundHover, and ToolbarBackgroundPressed control colors. ToolbarNormalHeight / ToolbarCompactHeight default to 60 / 40; button heights default to 48 / 32. Increase these when using larger icons or content. Resource changes apply at runtime.

Custom themes

Register your Avalonia theme before MiniToolbarStyles. Native toolbar controls retain that theme's templates and behavior; the application must supply themes for the native controls it uses. MiniToolbar's dimensions and spacing are dynamic resources in Themes/MiniToolbarStyles.axaml; its light/dark brushes are in the merged Themes/Colors.axaml dictionary. Native template internals remain the responsibility of the host theme.

Override resources on a toolbar or enclosing container, for example:

<toolbar:Toolbar xmlns="https://github.com/avaloniaui"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:toolbar="clr-namespace:MiniToolbar.Avalonia;assembly=MiniToolbar.Avalonia">
    <toolbar:Toolbar.Resources>
        <x:Double x:Key="ToolbarComboBoxMinWidth">160</x:Double>
        <x:Double x:Key="ToolbarButtonNormalHeight">52</x:Double>
        <Thickness x:Key="ToolbarActionPadding">12,4</Thickness>
        <CornerRadius x:Key="ToolbarControlCornerRadius">6</CornerRadius>
    </toolbar:Toolbar.Resources>
    <toolbar:ToolbarToggleButton Content="Snap" />
</toolbar:Toolbar>

Spacing resources include ToolbarButtonPadding, ToolbarButtonTextPadding, ToolbarButtonSpacing, ToolbarActionPadding, ToolbarInputPadding, ToolbarComboBoxPadding, and ToolbarCheckBoxPadding. Margins use ToolbarButtonMargin, ToolbarItemMargin (combo boxes, check boxes, horizontal separators), ToolbarActionMargin, ToolbarInputMargin (inputs and content hosts), ToolbarHorizontalSpacing (horizontal panel and slider), ToolbarVerticalPanelMargin, ToolbarVerticalSeparatorMargin, and ToolbarVerticalSliderMargin. Labels share ToolbarButtonPadding.

Use ToolbarButtonCornerRadius / ToolbarControlCornerRadius for rounding and ToolbarHorizontalBorderThickness, ToolbarVerticalBorderThickness, ToolbarButtonBorderThickness, ToolbarButtonFocusBorderThickness, and ToolbarComboBoxItemBorderThickness for borders. ToolbarControlMinHeight defaults to zero so native action buttons and inputs can fit compact rows; ToolbarButtonDisabledOpacity controls disabled button opacity. All width and height defaults, including ToolbarComboBoxMinWidth, can be overridden without replacing a template. Explicit values on individual controls take precedence.

See the user guide and demo for all controls, examples, resource keys, and custom-template guidance.

Licensed under MIT.

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. 
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.1.0.138 88 11/15/2026
2.0.1.138 92 11/15/2026
2.0.0.7 372 7/7/2026
1.2.0.260 415 9/17/2025
1.1.0.216 1,289 8/5/2025
1.0.81 3,339 9/19/2024
1.0.26 436 7/27/2024
0.9.177 350 12/24/2023
0.8.75 261 9/13/2023
0.7.73 260 9/11/2023
0.6.69 257 9/6/2023