StatusBar.Avalonia 0.0.1

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

StatusBar.Avalonia

NuGet Version NuGet Downloads

A status bar control for AvaloniaUI, inspired by the Visual Studio Code status bar. It features a simple and flexible API.

overview


Features

  • Embed icons directly in the status text. Refer to the VS Code Icon Reference.

  • Support for custom content custom content

  • Built-in context menu for enabling/disabling status bar items contextmenu

  • Built-in color themes color theme

  • Simple click event handling

    click-action

  • Temporarily display a status bar item temporary message

Getting Started

1. Install via NuGet

Install-Package StatusBar.Avalonia

2. Reference the style in App.axaml

<Application ...
        xmlns:status="https://github.com/xiyaowong/StatusBar.Avalonia"
        ...>
    <Application.Styles>
        <status:StatusBarTheme/>
    </Application.Styles>
</Application>

3. Add the StatusBarContainer to your layout

<status:StatusBarContainer Name="_StatusBarContainer"/>

4. Create and bind the StatusBarManager

public StatusBarManager StatusBarManager { get; } = new();

...

StatusBarManager.BindContainer(_StatusBarContainer);

5. Create and display a status bar item

var status = StatusBarManager.CreateStatusBarItem("status");
status.Text = "Hello World";
status.Show();

Usage

Embedding icons in text

status.Text = "$(git-branch) master"; // a git branch icon
status.Text = "$(sync~spin) Syncing..."; // a spinning sync icon

Custom content

status.Content = new TextBlock
{
    Text = "Hello World",
    FontStyle = FontStyle.Italic,
};

Context menu

Enabled by default. To disable it, set the DisableDefaultContextMenu property of StatusBarContainer to true.

The DisabledItems property on StatusBarContainer contains the list of disabled items.

Click action

status.Click = () =>
{
    // Do something when the status bar item is clicked
};

Temporary messages

// show 'Hello world!' for 3 seconds
status.SetStatusBarMessage("Hello world!", 3000);
// show 'Hello world!' until the action is completed
status.SetStatusBarMessage("Hello world!", async () =>
{
    // Do something
});

Theming

Built-in themes

  • DarkPlus
  • OneDark
  • GithubDefault

Set the ColorTheme property of StatusBarContainer to apply a theme.

Customizable colors

  • StatusBarBackground - the background color of the status bar
  • StatusBarForeground - the foreground color of the status bar
  • StatusBarItemHoverBackground - the background color of the status bar item when hovered
  • StatusBarItemHoverForeground - the foreground color of the status bar item when hovered
  • StatusBarItemActiveBackground - the background color of the status bar item when active (pressed)

Demo


Resources


License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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
0.0.1 121 5/22/2025