Skip to content
docsv0.3.0

TextRenderer

Renders multi-line text with word wrapping, alignment, and padding. The TUI analog of pi-tui's `Text` component: pure node-in/frame-out, no state, no keyboard handling. Wraps via {@see TuiString::wordwrap()} so multibyte content (accents, emoji) wraps at the same column count ASCII would. Node props (all optional): - `content` string Text to render. Alias: `text`. Default: ''. - `wrap` bool Word-wrap long lines to fit width. Default: true. - `align` string 'left' | 'center' | 'right'. Default: 'left'. - `padding` int Horizontal padding (columns, both sides). Default: 0. - `paddingX` int Override horizontal padding (wins over `padding`). Default: 0. - `paddingY` int Vertical padding (rows, top + bottom). Default: 0. - `fill` string Background fill character for empty cells. Default: ' '.

TextRenderer::supports()

public function supports(Milpa\Live\ValueObjects\Tui\TuiNode $node): bool

True only for `text` nodes — dispatch is by declared node type, never by where the node came from.

Parameters

Parameters of supports()
NameTypeDescription
$nodeMilpa\Live\ValueObjects\Tui\TuiNode

TextRenderer::render()

public function render(Milpa\Live\ValueObjects\Tui\TuiNode $node, Milpa\Live\ValueObjects\Tui\TuiRenderContext $context): Milpa\Live\ValueObjects\Tui\TuiFrame

Draws the wrapped, aligned and padded text within the bounds.

Parameters

Parameters of render()
NameTypeDescription
$nodeMilpa\Live\ValueObjects\Tui\TuiNode
$contextMilpa\Live\ValueObjects\Tui\TuiRenderContext