tui label for viewers
Add static text: inline, or as the title bar (--titlebar) or status bar (--status).
Command Type
built-in
Signature
> tui label {flags} (text)
Flags
--titlebar: Show as the title bar at the top.--title: Show as the title bar at the top (deprecated, use --titlebar).--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. Not with --from or a closure.--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 --titlebar "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. --titlebar 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. A closure with no table, tree, or select to follow is an error when the TUI starts.