API Reference
Ui
Factories that let a layout read like the screen, for using static ConsoleMonster.Ui;: Terminal.Write(Rows( Columns( Panel("Servers", Table(servers).Column(s => s.Name, c => c.WithIsKey()).WithTotals()), Panel("Summary", KeyValue(("Servers", 3), ("Failed", 1)))), Text("[muted]updated 10:02[/]"))); Each one only creates the widget it names (the same object model as new Panel(...)), so the result can be configured further with object initializers or the generated With... methods. For layouts whose live widgets are needed as typed handles, DashboardBuilder hands them back through out parameters.
Inheritance
- Object
- Ui
Methods
public static Columns Columns(params IWidget[] children) #ColumnsChildren side by side, sharing the width equally unless sized (Columns).
Parameters
Returns
The columns.
public static Dashboard Dashboard(String title, IWidget body) #DashboardA dashboard shell (header, body and key footer) for a live session (Dashboard).
Parameters
- title System.String
- The title (markup).
- body ConsoleMonster.Layout.IWidget
- The body.
Returns
The dashboard.
public static Sized Fill(IWidget widget, Double weight = 1) #SizedA child that takes a share of the remaining height (in rows) or width (in columns).
Parameters
- widget ConsoleMonster.Layout.IWidget
- The child.
- weight System.Double = 1
- Its share relative to other filling children (default 1).
Returns
The sized child.
public static Sized Fixed(IWidget widget, Int32 cells) #SizedA child with a fixed height (in rows) or width (in columns).
Parameters
- widget ConsoleMonster.Layout.IWidget
- The child.
- cells System.Int32
- The size in rows or cells.
Returns
The sized child.
public static Grid Grid(Int32 columns, params IWidget[] children) #GridChildren in a grid with a number of columns, filled row by row (Grid).
Parameters
- columns System.Int32
- The number of columns.
- children ConsoleMonster.Layout.IWidget[]
- The children.
Returns
The grid.
public static KeyValueList KeyValue(params ValueTuple<String, Object?>[] items) #KeyValueListKey/value pairs, values formatted by their type (KeyValueList).
Parameters
- items System.ValueTuple<System.String, System.Object?>[]
- The pairs, in order.
Returns
The list.
public static Lanes Lanes(params String[] keys) #LanesProgress lanes, one per key (Lanes), each waiting to start.
Parameters
- keys System.String[]
- The lane keys (also their labels).
Returns
The lanes.
public static TreeNode Node(String label, params TreeNode[] children) #TreeNodeA tree node with children (TreeNode).
Parameters
- label System.String
- The label (markup).
- children ConsoleMonster.Widgets.TreeNode[]
- The child nodes.
Returns
The node.
public static TreeNode Node(String label, StatusKind? status, params TreeNode[] children) #TreeNodeA tree node with a state marker and children (TreeNode).
Parameters
- label System.String
- The label (markup).
- status ConsoleMonster.Styling.StatusKind?
- The state shown before the label, or null.
- children ConsoleMonster.Widgets.TreeNode[]
- The child nodes.
Returns
The node.
public static Panel Panel(String title, IWidget content) #PanelA titled panel around content (Panel).
Parameters
- title System.String
- The title (markup).
- content ConsoleMonster.Layout.IWidget
- The content.
Returns
The panel.
public static ProgressBar Progress(String label, Double value = 0, Double total = 100) #ProgressBarA progress bar (ProgressBar).
Parameters
- label System.String
- The label (markup).
- value System.Double = 0
- The current value.
- total System.Double = 100
- The total (0 for an unknown total).
Returns
The progress bar.
public static Rows Rows(params IWidget[] children) #RowsChildren stacked top to bottom (Rows).
Parameters
Returns
The rows.
public static Rule Rule(String? title = null) #RuleA horizontal rule with an optional title (Rule).
Parameters
- title System.String? = null
- The title (markup), or null.
Returns
The rule.
public static Sparkline Sparkline(IEnumerable<Double> values) #SparklineA sparkline of values (Sparkline).
Parameters
- values System.Collections.Generic.IEnumerable<System.Double>
- The values, oldest first.
Returns
The sparkline.
public static StatusList Status(params ValueTuple<String, StatusKind>[] items) #StatusListA list of labelled states (StatusList).
Parameters
- items System.ValueTuple<System.String, ConsoleMonster.Styling.StatusKind>[]
- The labels and their states, in order.
Returns
The status list.
public static Table Table() #TableAn empty table, to fill with columns and rows.
Returns
The table.
public static Table<T?> Table<T>(IEnumerable<T?> items) #Table<T?>A table whose rows are read from typed items (Table.For).
Type Parameters
- T
- The item type.
Parameters
- items System.Collections.Generic.IEnumerable<T?>
- The items.
Returns
The table; add columns with Column(s => s.Name).
public static TextBlock Text(String markup) #TextBlockText with markup (TextBlock); [bold], [pass], [muted] and the other tags apply.
Parameters
- markup System.String
- The markup.
Returns
The text block.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?