ConsoleForge 0.3.0
Elm-architecture TUI framework for .NET 8
Loading...
Searching...
No Matches
ConsoleForge.Widgets.ZStack Class Referencesealed

A layered widget that renders its children back-to-front over the same region. More...

Inheritance diagram for ConsoleForge.Widgets.ZStack:

Public Member Functions

void Render (IRenderContext ctx)
 Renders each layer over the same region in declaration order.
 ZStack ()
 Object-initializer constructor; all properties default.
 ZStack (IReadOnlyList< IWidget > layers)
 Positional constructor for inline usage.

Properties

SizeConstraint Height = SizeConstraint.Flex(1) [get]
 Height constraint used by the layout engine.
IReadOnlyList< IWidgetLayers = [] [get]
 Layers in back-to-front order. The last layer renders on top.
Style Style = Style.Default [get]
 Visual style for the stack. Not rendered directly — ZStack has no visual output of its own.
SizeConstraint Width = SizeConstraint.Flex(1) [get]
 Width constraint used by the layout engine.

Detailed Description

A layered widget that renders its children back-to-front over the same region.

Each layer is given the full allocated region; later layers paint over earlier ones.

Typical usage — base layout + optional overlay:

new ZStack([
mainLayout,
isModalOpen ? new Modal(...) : new TextBlock(""),
])
A centered dialog overlay widget.
Definition Modal.cs:31
A widget that renders a single string, wrapping at region width.
Definition TextBlock.cs:11
ZStack()
Object-initializer constructor; all properties default.
Definition ZStack.cs:36

Core.FocusManager traverses all layers for focus collection, so interactive widgets in any layer participate in Tab-order traversal.

Constructor & Destructor Documentation

◆ ZStack()

ConsoleForge.Widgets.ZStack.ZStack ( IReadOnlyList< IWidget > layers)

Positional constructor for inline usage.

Parameters
layersLayers in back-to-front render order.

Member Function Documentation

◆ Render()

void ConsoleForge.Widgets.ZStack.Render ( IRenderContext ctx)

Renders each layer over the same region in declaration order.

Later layers paint over earlier ones, producing a stacked visual effect.

Implements ConsoleForge.Layout.IWidget.


The documentation for this class was generated from the following file:
  • src/ConsoleForge/Widgets/ZStack.cs