Skip to content

InfoBar

A horizontal status bar widget for displaying contextual information at the edge of your application. InfoBar is commonly used to show mode indicators, file status, cursor position, and other metadata.

Basic Usage

Create an InfoBar with sections separated by a default separator:

csharp

Spacer

Use Spacer() to push sections apart. The spacer expands to fill available space:

csharp

Separators

Control how sections are visually separated:

Default Separator

Use .WithDefaultSeparator() to automatically insert separators between consecutive sections:

csharp

Explicit Separators

Add separators manually for fine-grained control:

csharp
ctx.InfoBar(s => [
    s.Section("Mode"),
    s.Separator(" │ "),  // Explicit separator
    s.Section("File"),
    // No separator here
    s.Spacer(),
    s.Section("Ready")
])

Widget Content

Sections can contain any widget, not just text. This enables rich status displays:

csharp

Width Control

Control how sections size themselves:

csharp

Width Options

MethodDescription
.ContentWidth()Size to fit content (default)
.FixedWidth(n)Fixed width in columns
.FillWidth()Expand to fill available space
.FillWidth(weight)Proportional fill with weight

Alignment

Within fixed-width sections, control text alignment:

csharp
s.Section("Left").FixedWidth(20).AlignLeft()    // Default
s.Section("Center").FixedWidth(20).AlignCenter()
s.Section("Right").FixedWidth(20).AlignRight()

Per-Section Theming

Apply custom colors to individual sections using .Theme():

csharp

Color Inversion

By default, InfoBar inverts foreground and background colors to create visual distinction. Disable this with .InvertColors(false):

csharp
ctx.InfoBar(s => [
    s.Section("Normal colors")
]).InvertColors(false)
  • Text - For simple text display
  • Spinner - Animated activity indicators for InfoBar sections
  • ThemePanel - For broader theme customization

Released under the MIT License.