Overview
TheTextRenderable component displays text content in your terminal UI. It supports styled text with colors and attributes, text wrapping modes, text selection, and dynamic composition using TextNodes.
Basic Usage
Props
string | StyledText
Text content to display. Can be a plain string or a StyledText object with inline styling.
string | RGBA
Foreground color for the text (e.g.,
"#FF0000" or "red").string | RGBA
Background color for the text.
'none' | 'char' | 'word'
default:"'none'"
Text wrapping behavior:
'none': No wrapping, text extends beyond bounds'char': Wrap at any character'word': Wrap at word boundaries
boolean
default:"false"
Enable text selection with mouse or keyboard.
string | RGBA
Background color for selected text.
string | RGBA
Foreground color for selected text.
boolean
default:"false"
Enable middle truncation with ellipsis when text exceeds available width.
number | string
Width of the text container. Accepts numbers (pixels) or strings like
"100%" or "50%".number | string
Height of the text container.