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:
dotnet runSpacer
Use Spacer() to push sections apart. The spacer expands to fill available space:
dotnet runSeparators
Control how sections are visually separated:
Default Separator
Use .WithDefaultSeparator() to automatically insert separators between consecutive sections:
Explicit Separators
Add separators manually for fine-grained control:
ctx.InfoBar(s => [
s.Section("Mode"),
s.Separator(" │ "), // Explicit separator
s.Section("File"),
// No separator here
s.Spacer(),
s.Section("Ready")
])2
3
4
5
6
7
8
Widget Content
Sections can contain any widget, not just text. This enables rich status displays:
dotnet runWidth Control
Control how sections size themselves:
Width Options
| Method | Description |
|---|---|
.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:
s.Section("Left").FixedWidth(20).AlignLeft() // Default
s.Section("Center").FixedWidth(20).AlignCenter()
s.Section("Right").FixedWidth(20).AlignRight()2
3
Per-Section Theming
Apply custom colors to individual sections using .Theme():
Color Inversion
By default, InfoBar inverts foreground and background colors to create visual distinction. Disable this with .InvertColors(false):
ctx.InfoBar(s => [
s.Section("Normal colors")
]).InvertColors(false)2
3
Related Widgets
- Text - For simple text display
- Spinner - Animated activity indicators for InfoBar sections
- ThemePanel - For broader theme customization