Skip to content
ConsoleMonster
Class

FooterBar

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Implements
IWidget
Modifiers
sealed

The one key-hint footer of every surface (dashboards, menus, forms, prompts, runs, inline areas): a row starting at column 1 with keys in Accent and labels in Muted, two spaces between hints, optional text on the right (Muted), and a toast or message replacing the hints while it shows. No band, so it reads the same full screen and inline. Hints that do not fit are dropped from the end, keeping the last (help) hint when asked. See Docs/Design-System.md.

Inheritance

  • object
  • FooterBar

Usage

Explore 43 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 21

Accepted by parameters 22

Constructors

public FooterBar(IEnumerable<KeyHint>? hints = null) #

Creates a footer.

Parameters

hints System.Collections.Generic.IEnumerable<ConsoleMonster.Widgets.KeyHint>? = null optional
The hints, in order.

Methods

public static StyledLine Line(IReadOnlyList<KeyHint> hints, RenderContext context, int available, bool keepLast = false) #

The hints as one styled line no wider than available cells.

Parameters

hints System.Collections.Generic.IReadOnlyList<ConsoleMonster.Widgets.KeyHint> required
The hints.
context ConsoleMonster.Canvas.RenderContext required
The render context.
available int required
The width.
keepLast bool = false optional
Keeps the last hint when others are dropped.

Returns

StyledLine The line.
public Size Measure(Constraints constraints, RenderContext context) #

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The space offered.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Returns

Size The desired size, never larger than the constraints.
public void Render(Region region, RenderContext context) #

Renders into a region. The region may be smaller or larger than the measured size.

Parameters

region ConsoleMonster.Canvas.Region required
The target region.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Properties

public List<KeyHint> Hints { get; } #

The hints, in order.

public Func<IEnumerable<KeyHint>>? HintsSource { get; set; } #
Fluent("HintsBy")

Reads current registry hints at render time, for example from the focused panel or active dialog. In an app, a footer with neither hints nor a source shows the app's key bindings.

public bool FixedSlots { get; set; } #

Keeps every registry entry in a fixed slot, shortening labels rather than hiding unavailable or trailing commands.

public bool KeepLast { get; set; } #

Keeps the last hint (the key map) when others have to be dropped.

public StyledLine? Message { get; set; } #

A line shown instead of the hints (a toast), or null.

public StyledLine? Right { get; set; } #

Text on the right, or null.

public List<FooterSegment> Segments { get; } #

Segments on the right (after FooterBar.Right), separated by a dot: a run id, a report link, a status.

public int Indent { get; set; } #

The first column (default 1).

Extension Methods

public static FooterBar FixedSlots(FooterBar footerBar, bool value = true) #

Sets FooterBar.FixedSlots: Keeps every registry entry in a fixed slot, shortening labels rather than hiding unavailable or trailing commands.

Parameters

footerBar ConsoleMonster.Widgets.FooterBar required
The instance.
value bool = true optional
The value; true when omitted.

Returns

FooterBar The same instance.

Examples

// C# initializer or property                                           // C# fluent
new global::ConsoleMonster.Widgets.FooterBar { FixedSlots = value };    Ui.FooterBar().FixedSlots(value);
public static FooterBar Hint(FooterBar footerBar, KeyHint item) #

Adds an item to FooterBar.Hints: The hints, in order.

Parameters

footerBar ConsoleMonster.Widgets.FooterBar required
The instance.
item ConsoleMonster.Widgets.KeyHint required
The item.

Returns

FooterBar The same instance.
public static FooterBar Hints(FooterBar footerBar, IEnumerable<KeyHint> items) #

Adds items to FooterBar.Hints: The hints, in order.

Parameters

footerBar ConsoleMonster.Widgets.FooterBar required
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Widgets.KeyHint> required
The items, in order.

Returns

FooterBar The same instance.
public static FooterBar HintsBy(FooterBar footerBar, Func<IEnumerable<KeyHint>>? value) #

Sets FooterBar.HintsSource: Reads current registry hints at render time, for example from the focused panel or active dialog. In an app, a footer with neither hints nor a source shows the app's key bindings.

Parameters

footerBar ConsoleMonster.Widgets.FooterBar required
The instance.
value System.Func<System.Collections.Generic.IEnumerable<ConsoleMonster.Widgets.KeyHint>>? required
The callback.

Returns

FooterBar The same instance.

Examples

// C# initializer or property                                            // C# fluent
new global::ConsoleMonster.Widgets.FooterBar { HintsSource = value };    Ui.FooterBar().HintsBy(value);
public static FooterBar Indent(FooterBar footerBar, int value) #

Sets FooterBar.Indent: The first column (default 1).

Parameters

footerBar ConsoleMonster.Widgets.FooterBar required
The instance.
value int required
The value.

Returns

FooterBar The same instance.

Examples

// C# initializer or property                                       // C# fluent
new global::ConsoleMonster.Widgets.FooterBar { Indent = value };    Ui.FooterBar().Indent(value);
public static FooterBar KeepLast(FooterBar footerBar, bool value = true) #

Sets FooterBar.KeepLast: Keeps the last hint (the key map) when others have to be dropped.

Parameters

footerBar ConsoleMonster.Widgets.FooterBar required
The instance.
value bool = true optional
The value; true when omitted.

Returns

FooterBar The same instance.

Examples

// C# initializer or property                                         // C# fluent
new global::ConsoleMonster.Widgets.FooterBar { KeepLast = value };    Ui.FooterBar().KeepLast(value);
public static FooterBar Message(FooterBar footerBar, StyledLine? value) #

Sets FooterBar.Message: A line shown instead of the hints (a toast), or null.

Parameters

footerBar ConsoleMonster.Widgets.FooterBar required
The instance.
value ConsoleMonster.Text.StyledLine? required
The value.

Returns

FooterBar The same instance.

Examples

// C# initializer or property                                        // C# fluent
new global::ConsoleMonster.Widgets.FooterBar { Message = value };    Ui.FooterBar().Message(value);
public static FooterBar Right(FooterBar footerBar, StyledLine? value) #

Sets FooterBar.Right: Text on the right, or null.

Parameters

footerBar ConsoleMonster.Widgets.FooterBar required
The instance.
value ConsoleMonster.Text.StyledLine? required
The value.

Returns

FooterBar The same instance.

Examples

// C# initializer or property                                      // C# fluent
new global::ConsoleMonster.Widgets.FooterBar { Right = value };    Ui.FooterBar().Right(value);
public static FooterBar Segment(FooterBar footerBar, FooterSegment item) #

Adds an item to FooterBar.Segments: Segments on the right (after FooterBar.Right), separated by a dot: a run id, a report link, a status.

Parameters

footerBar ConsoleMonster.Widgets.FooterBar required
The instance.
item ConsoleMonster.Widgets.FooterSegment required
The item.

Returns

FooterBar The same instance.
public static FooterBar Segments(FooterBar footerBar, IEnumerable<FooterSegment> items) #

Adds items to FooterBar.Segments: Segments on the right (after FooterBar.Right), separated by a dot: a run id, a report link, a status.

Parameters

footerBar ConsoleMonster.Widgets.FooterBar required
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Widgets.FooterSegment> required
The items, in order.

Returns

FooterBar The same instance.