Skip to content
ConsoleMonster

API Reference

Class

FooterBar

Namespace ConsoleMonster.Widgets
Assembly ConsoleMonster
Implements
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 24 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.

Accepted by parameters 12

Constructors

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

Creates a footer.

Parameters

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

Methods

public static StyledLine Line(IReadOnlyList<KeyHint> hints, RenderContext context, Int32 available, Boolean keepLast = false) #
Returns: StyledLine

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

Parameters

hints System.Collections.Generic.IReadOnlyList<ConsoleMonster.Widgets.KeyHint> requiredposition: 0
The hints.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
The render context.
available System.Int32 requiredposition: 2
The width.
keepLast System.Boolean = false optionalposition: 3
Keeps the last hint when others are dropped.

Returns

The line.

public Size Measure(Constraints constraints, RenderContext context) #
Returns: Size

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints requiredposition: 0
The space offered.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Returns

The desired size, never larger than the constraints.

public Void Render(Region region, RenderContext context) #
Returns: Void

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

Parameters

region ConsoleMonster.Canvas.Region requiredposition: 0
The target region.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Properties

public List<KeyHint> Hints { get; } #

The hints, in order.

public Boolean 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 Int32 Indent { get; set; } #

The first column (default 1).

Extension Methods

public static FooterBar AddHint(FooterBar footerBar, KeyHint item) #
Returns: FooterBar

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

Parameters

footerBar ConsoleMonster.Widgets.FooterBar requiredposition: 0
The instance.
item ConsoleMonster.Widgets.KeyHint requiredposition: 1
The item.

Returns

The same instance.

AddHints 2 overloads
public static FooterBar AddHints(FooterBar footerBar, params KeyHint[] items) #
Returns: FooterBar

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

Parameters

footerBar ConsoleMonster.Widgets.FooterBar requiredposition: 0
The instance.
items ConsoleMonster.Widgets.KeyHint[] requiredposition: 1
The items, in order.

Returns

The same instance.

public static FooterBar AddHints(FooterBar footerBar, IEnumerable<KeyHint> items) #
Returns: FooterBar

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

Parameters

footerBar ConsoleMonster.Widgets.FooterBar requiredposition: 0
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Widgets.KeyHint> requiredposition: 1
The items, in order.

Returns

The same instance.

public static FooterBar WithIndent(FooterBar footerBar, Int32 value) #
Returns: FooterBar

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

Parameters

footerBar ConsoleMonster.Widgets.FooterBar requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

public static FooterBar WithKeepLast(FooterBar footerBar, Boolean value = true) #
Returns: FooterBar

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

Parameters

footerBar ConsoleMonster.Widgets.FooterBar requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static FooterBar WithMessage(FooterBar footerBar, StyledLine? value) #
Returns: FooterBar

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

Parameters

footerBar ConsoleMonster.Widgets.FooterBar requiredposition: 0
The instance.
value ConsoleMonster.Text.StyledLine? requiredposition: 1
The value.

Returns

The same instance.

public static FooterBar WithRight(FooterBar footerBar, StyledLine? value) #
Returns: FooterBar

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

Parameters

footerBar ConsoleMonster.Widgets.FooterBar requiredposition: 0
The instance.
value ConsoleMonster.Text.StyledLine? requiredposition: 1
The value.

Returns

The same instance.