Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

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:

inputoutput
nothingtui
tuitui
anytui

Examples

Title and status around a table

> ls | tui label --title "files" | tui table | tui label --status "enter: pick  q: quit" | tui run

Inline text above a text box

> tui label "new name" | tui textbox | tui debug | get screen

A label that follows the highlighted row

> ls | tui table | tui label {|row| $"size: ($row.size)" } | tui run

Notes

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.