Text
IText renders a plain string verbatim. No markup parsing — every character is literal.
When to use
- Embedding a string inside another widget (table cell, panel body, column) where you want no styling and no
[]interpretation. - Otherwise, prefer
AnsiConsole.WriteLineorMarkupfor direct output.
TIP
For styled text, use Markup. For wrapped paragraphs with alignment / justification, use Paragraph.
Basic usage
pascal
AnsiConsole.Write(Widgets.Text('Plain unstyled text'));1
With an explicit base style:
pascal
AnsiConsole.Write(
Widgets.Text('Styled text',
TAnsiStyle.Plain
.WithForeground(TAnsiColor.Aqua)
.WithDecorations([TAnsiDecoration.Bold])));1
2
3
4
5
2
3
4
5
Configuration
IText is intentionally minimal — there are no further configuration knobs. For more control (alignment, overflow), use Paragraph or Markup.
Composition
Text widgets are commonly used as table cells, grid rows, or column items when you want literal content rather than markup:
pascal
table.AddRow([Widgets.Text('plain'),
Widgets.Markup('[red]styled[/]')]);1
2
2
API reference
Widgets.Text(value)— plain text.Widgets.Text(value, style)— text with a base style.