Skip to content
docsv0.3.0

BoxRenderer

A padded container with optional border and background fill. The TUI analog of pi-tui's `Box`. Unlike `GenericPanelRenderer` (which draws a titled chrome box around static `lines` props), this renderer is a pure wrapper: the children are laid out by `SimpleTuiLayoutEngine` into the inset region this renderer declares via `padding`/`border`, and this renderer only paints the chrome (border + background fill) around the already-composed child frames. Node props (all optional): - `padding` int Inner padding on every side. Default: 0. - `paddingX` int Horizontal padding (wins over `padding`). Default: 0. - `paddingY` int Vertical padding. Default: 0. - `border` bool Draw a border around the box. Default: false. - `title` string Inline title in the top border (only if `border`). Default: ''. - `bg` string Background fill character for the inner region. Default: ' '. - `focused` bool Override focus state (otherwise context.focused()). Default: context.focused().

BoxRenderer::supports()

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

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

Parameters

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

BoxRenderer::render()

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

Draws the border, padding and fill, leaving the interior to the children the layout engine positions inside these bounds.

Parameters

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