Skip to content

InfoBarWidget

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

A horizontal info bar widget, typically placed at the bottom of the screen. Supports sections, dividers, and spacers with flexible layout options.

csharp
public sealed record InfoBarWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<InfoBarWidget>

Inheritance

ObjectHex1bWidgetInfoBarWidget

Implements

Constructors

InfoBarWidget(IReadOnlyList<IInfoBarChild>, bool)

A horizontal info bar widget, typically placed at the bottom of the screen. Supports sections, dividers, and spacers with flexible layout options.

Parameters:

  • Children (IReadOnlyList<IInfoBarChild>): The info bar children (sections, dividers, spacers).
  • InvertColors (Boolean): Whether to invert foreground/background colors (default: true).
csharp
public InfoBarWidget(IReadOnlyList<IInfoBarChild> Children, bool InvertColors = true)

Properties

Children

The info bar children (sections, dividers, spacers).

Returns: IReadOnlyList<IInfoBarChild>

csharp
public IReadOnlyList<IInfoBarChild> Children { get; init; }

DefaultDivider

The default divider to insert between consecutive sections. When null, no automatic dividers are inserted.

Returns: InfoBarDividerWidget

csharp
public InfoBarDividerWidget? DefaultDivider { get; init; }

InvertColors

Whether to invert foreground/background colors (default: true).

Returns: Boolean

csharp
public bool InvertColors { get; init; }

Methods

Divider(string, Hex1bColor?, Hex1bColor?)

Sets the default divider that is automatically inserted between consecutive sections.

Parameters:

Returns: InfoBarWidget

A new with the default divider configured.

csharp
public InfoBarWidget Divider(string character = " | ", Hex1bColor? foreground = null, Hex1bColor? background = null)

Examples

csharp
// Basic info bar with an automatic divider between consecutive sections
ctx.InfoBar(s => [
    s.Section("NORMAL"),
    s.Section("file.cs"),
    s.Section("Ln 42")
]).Divider(" | ")

// Info bar with a spacer to push content right
ctx.InfoBar(s => [
    s.Section("Mode"),
    s.Spacer(),
    s.Section("Ready")
])

Released under the MIT License.