Skip to content

StatusBar

The StatusBar widget displays status information in three sections: left, center, and right. It’s commonly used at the bottom of applications to show current state, messages, or help text.

StatusBar provides a convenient way to display status information with automatic text positioning. It’s typically 1 line tall and spans the width of the application.

Text displayed on the left side of the status bar.

statusBar.LeftText = "Ready";

Text displayed in the center of the status bar.

statusBar.CenterText = "Processing...";

Text displayed on the right side of the status bar.

statusBar.RightText = "ESC to exit";

The background color of the status bar.

statusBar.StatusBarBackground = Color.DarkGray;

The foreground (text) color of the status bar.

statusBar.StatusBarForeground = Color.White;

SetStatus(string? left, string? center, string? right)

Section titled “SetStatus(string? left, string? center, string? right)”

Sets all status bar text at once. Pass null to leave a section unchanged.

statusBar.SetStatus(left: "Ready", center: "Processing", right: "ESC to exit");
var statusBar = new StatusBar
{
X = 0,
Y = Console.WindowHeight - 1,
Width = Console.WindowWidth,
Height = 1,
LeftText = "Elaris v0.1.0",
CenterText = "Ready",
RightText = "ESC to exit",
StatusBarBackground = Color.DarkGray,
StatusBarForeground = Color.White
};
// Update status dynamically
statusBar.CenterText = "Processing file...";
statusBar.LeftText = "File: example.txt";

If text is too long for its section (more than 1/3 of the width), it will be automatically truncated to fit.

statusBar.LeftText = $"Lines: {lineCount}";
statusBar.CenterText = "Ready";
statusBar.RightText = $"Cursor: {cursorX},{cursorY}";
statusBar.CenterText = $"Progress: {percentage}%";
statusBar.RightText = "F1: Help | ESC: Exit";