tui split for viewers
Lay out child widgets side by side (or stacked with --vertical) with draggable dividers.
Command Type
built-in
Signature
> tui split {flags} (children)
Flags
--vertical, -v: Stack children top to bottom.--sizes, -s {list<any>}: One size per child: cells, "30%", "1fr", "min:N", "max:N".--ratio, -r {int}: Percent of space for the first child; the rest share the remainder.--id {string}: Widget id.--focus: Start with this widget focused.
Parameters
children: Widgets to arrange, e.g. [(tui table) (tui preview)].
Input/output types:
| input | output |
|---|---|
| nothing | tui |
| tui | tui |
| any | tui |
Examples
Table on the left, file preview on the right
> ls | tui split --sizes [40% 1fr] [(tui table --columns [name size]) (tui preview)] | tui runA fixed 30-cell sidebar
> ls | tui split --sizes [30 1fr] [(tui tree --walk) (tui preview)] | tui runTwo tables with their own rows
> tui split [(ls | tui table) (ps | tui table)] | tui runNotes
Children are tui values built in parentheses: tui split [(tui table) (tui preview)]. A child can carry its own rows: [(ls | tui table) (ps | tui table)]. Splits nest.
--sizes gives one size per child: an int is cells (20), "30%" a share of the split, "1fr" a share of what is left ("2fr" twice as much), "min:10" / "max:40" bounds. Missing entries are 1fr. --ratio 60 is shorthand for --sizes [60% 1fr]. Drag a divider with the mouse, or Tab to the split and use arrows/hjkl for 1% steps.