Skip to Content

Text

Text is the smallest textual widget. Use it when you only need to place a short string with optional style.

Text
Text terminal preview
Terminal preview of Text

Smallest example

let label = Text::new("Ready").build();

Use Text when

  • the content is short
  • you do not need wrapping options
  • you do not need a frame or block

Key builder methods

  • Text::new(...)
  • .style(...)
  • .layout(...)

For wrapped or aligned text, prefer Paragraph.

Last updated on