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

A layout container that arranges child widgets along a given axis. More...

Inheritance diagram for ConsoleForge.Widgets.Container:

Public Member Functions

 Container (Axis direction, IWidget[]? children=null, SizeConstraint? width=null, SizeConstraint? height=null, Style? style=null, bool scrollable=false)
 Primary constructor matching quickstart usage:
void Render (IRenderContext ctx)
 Render this widget into the provided context.

Properties

IReadOnlyList< IWidgetChildren = [] [get]
 Child widgets in declaration order.
Axis Direction [get]
 Layout direction for children.
SizeConstraint Height = SizeConstraint.Flex(1) [get]
 Height constraint used by the layout engine.
bool Scrollable [get]
 When true, children that overflow the container's main axis are clipped and scrollable via ScrollOffset.
int ScrollOffset [get]
 Row/column offset for scrollable containers.
Style Style = Style.Default [get]
 Visual style applied as background fill before children render.
SizeConstraint Width = SizeConstraint.Flex(1) [get]
 Width constraint used by the layout engine.

Detailed Description

A layout container that arranges child widgets along a given axis.

Participates in two-pass layout via IContainer. Supports optional scrolling along the main axis.

Constructor & Destructor Documentation

◆ Container()

ConsoleForge.Widgets.Container.Container ( Axis direction,
IWidget?[] children = null,
SizeConstraint? width = null,
SizeConstraint? height = null,
Style? style = null,
bool scrollable = false )

Primary constructor matching quickstart usage:

new Container(Axis.Vertical, children)
new Container(Axis.Horizontal, width: SizeConstraint.Fixed(24), children: [...])
Container(Axis direction, IWidget[]? children=null, SizeConstraint? width=null, SizeConstraint? height=null, Style? style=null, bool scrollable=false)
Primary constructor matching quickstart usage:
Definition Container.cs:20
Axis
Axis for container layout direction.
Definition LayoutEngine.cs:7
record SizeConstraint
Discriminated union for widget dimension constraints.
Definition SizeConstraint.cs:7

Member Function Documentation

◆ Render()

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

Render this widget into the provided context.

The context carries the allocated region, theme, and color profile. Implementations MUST NOT write outside ctx.Region.

Implements ConsoleForge.Layout.IWidget.

Property Documentation

◆ ScrollOffset

int ConsoleForge.Widgets.Container.ScrollOffset
get

Row/column offset for scrollable containers.

0-based lines/columns from the start of the children along the main axis.


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