tui label for viewers
Add static text: inline, or as the title bar (--title) or status bar (--status).
Command Type
built-in
Signature
> tui label {flags} (text)
Flags
--title: Show as the title bar at the top.--status: Show as the status bar at the bottom.--id {string}: Widget id.--focus: Start with this widget focused.--data {any}: Data for this widget alone, instead of the outer pipeline's.--from {string}: Id of the table, tree, or select whose highlighted row drives this widget.
Parameters
text: Label text, or a closure over the source row.
Input/output types:
| input | output |
|---|---|
| nothing | tui |
| tui | tui |
| any | tui |
Examples
Title and status around a table
> ls | tui label --title "files" | tui table | tui label --status "enter: pick q: quit" | tui runInline text above a text box
> tui label "new name" | tui textbox | tui debug | get screenA label that follows the highlighted row
> ls | tui table | tui label {|row| $"size: ($row.size)" } | tui runNotes
Without a flag the text is drawn where it appears in the layout. --title puts it on the one-line bar at the top (also used as the dialog title). --status puts it on the bottom bar, where live focus/filter/row hints are appended.
A closure instead of text makes the label follow a list: it receives the highlighted row of --from (or the nearest table/tree/select) and its output is shown.