Skip to content

Columns

IColumns lays out children horizontally. Children share the available width; tall children wrap their lines vertically as needed.

When to use

  • Side-by-side widgets without column-width control - just split the row.
  • Building summary dashboards.

For column-width control (auto / fixed / star) and row-by-row data, use Grid. For a bordered table with headers, use Table.

Basic usage

pascal
var
  cs : IColumns;
begin
  cs := Widgets.Columns;
  cs.Add(Widgets.Markup('[aqua]left column[/]'));
  cs.Add(Widgets.Markup('[yellow]middle column[/]'));
  cs.Add(Widgets.Markup('[lime]right column[/]'));
  AnsiConsole.Write(cs);
end;

Configuration

MethodPurpose
Add(child : IRenderable) : IColumnsAppend a column. Returns Self for chaining.
pascal
AnsiConsole.Write(
  Widgets.Columns
    .Add(Widgets.Panel(Widgets.Markup('[red]left[/]')))
    .Add(Widgets.Panel(Widgets.Markup('[green]middle[/]')))
    .Add(Widgets.Panel(Widgets.Markup('[blue]right[/]'))));

API reference

See also

  • Grid — when you need column-width control.
  • Rows — vertical counterpart.
  • Layout — for named, sized regions with nested splits.

Released under the MIT License.