TextBlockWidget
Namespace: Hex1b.Widgets
Assembly: Hex1b.dll
Displays text content in the terminal. This is the primary widget for rendering static or dynamic text strings.
public sealed record TextBlockWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<TextBlockWidget>Inheritance
Object → Hex1bWidget → TextBlockWidget
Implements
Constructors
TextBlockWidget(string, TextOverflow)
Displays text content in the terminal. This is the primary widget for rendering static or dynamic text strings.
Parameters:
Text(String): The text content to display.Overflow(TextOverflow): Controls how text handles horizontal overflow when it exceeds the available width. Defaults to .
public TextBlockWidget(string Text, TextOverflow Overflow = TextOverflow.Truncate)Properties
Overflow
Controls how text handles horizontal overflow when it exceeds the available width. Defaults to .
Returns: TextOverflow
public TextOverflow Overflow { get; init; }Text
The text content to display.
Returns: String
public string Text { get; init; }Remarks
TextBlockWidget is a read-only text display widget. For editable text input, use instead.
The widget supports three overflow behaviors: : Text is clipped by parent (no visual indicator): Text wraps to multiple lines at word boundaries: Text is truncated with "..." when it exceeds width
TextBlockWidget correctly handles Unicode text including wide characters (CJK), combining characters, and emoji.
Examples
Basic text display:
ctx.Text("Hello, World!")Text with wrapping:
ctx.Text("This long text will wrap to multiple lines").Wrap()Text with ellipsis truncation:
ctx.Text("Very long text that gets truncated...").Ellipsis()