Element

io.worxbend.tui.dsl.Element
See theElement companion object
sealed trait Element

A node of the retained-mode UI tree.

Every element ultimately renders through a tui-core Widget — the DSL is a declarative layer over tui-widgets, never a parallel rendering path. The sealed hierarchy is plain data: construction tests can pattern-match it, and styling extensions rebuild nodes instead of mutating them.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def widget: Widget

Concrete methods

Extension method from io.worxbend.tui.dsl

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

def bold: Element
Extension method from io.worxbend.tui.dsl

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

Extension method from io.worxbend.tui.dsl

Row/Column flex alignment and inter-child spacing. flex/center/spaceBetween/… only bite on row/column containers whose children leave leftover space (no fill child); elsewhere they are the identity.

Row/Column flex alignment and inter-child spacing. flex/center/spaceBetween/… only bite on row/column containers whose children leave leftover space (no fill child); elsewhere they are the identity.

Attributes

def children: Seq[Element]
def color(c: Color): Element
Extension method from io.worxbend.tui.dsl

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

def dim: Element
Extension method from io.worxbend.tui.dsl

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

Extension method from io.worxbend.tui.dsl

Double-line borders — meaningful on panels, identity elsewhere.

Double-line borders — meaningful on panels, identity elsewhere.

Attributes

def fill: Element
Extension method from io.worxbend.tui.dsl

Layout constraints — how much space the element claims inside its container.

Layout constraints — how much space the element claims inside its container.

Attributes

def fill(weight: Int): Element
Extension method from io.worxbend.tui.dsl

Layout constraints — how much space the element claims inside its container.

Layout constraints — how much space the element claims inside its container.

Attributes

def flex(mode: Flex): Element
Extension method from io.worxbend.tui.dsl

Row/Column flex alignment and inter-child spacing. flex/center/spaceBetween/… only bite on row/column containers whose children leave leftover space (no fill child); elsewhere they are the identity.

Row/Column flex alignment and inter-child spacing. flex/center/spaceBetween/… only bite on row/column containers whose children leave leftover space (no fill child); elsewhere they are the identity.

Attributes

Extension method from io.worxbend.tui.dsl

Row/Column flex alignment and inter-child spacing. flex/center/spaceBetween/… only bite on row/column containers whose children leave leftover space (no fill child); elsewhere they are the identity.

Row/Column flex alignment and inter-child spacing. flex/center/spaceBetween/… only bite on row/column containers whose children leave leftover space (no fill child); elsewhere they are the identity.

Attributes

Extension method from io.worxbend.tui.dsl

Opts a non-interactive element into the tab order (interactive elements are focusable by default).

Opts a non-interactive element into the tab order (interactive elements are focusable by default).

Attributes

def gap(cells: Int): Element
Extension method from io.worxbend.tui.dsl

Extra blank cells inserted between a row/column's children.

Extra blank cells inserted between a row/column's children.

Attributes

Extension method from io.worxbend.tui.dsl

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

def key(name: String): Element
Extension method from io.worxbend.tui.dsl

A stable focus identity: focus follows this key across renders even when the tree changes shape (without a key, focus is positional and can jump when elements appear or disappear).

A stable focus identity: focus follows this key across renders even when the tree changes shape (without a key, focus is positional and can jump when elements appear or disappear).

Attributes

def length(cells: Int): Element
Extension method from io.worxbend.tui.dsl

Layout constraints — how much space the element claims inside its container.

Layout constraints — how much space the element claims inside its container.

Attributes

def maxSize(cells: Int): Element
Extension method from io.worxbend.tui.dsl

Layout constraints — how much space the element claims inside its container.

Layout constraints — how much space the element claims inside its container.

Attributes

def minSize(cells: Int): Element
Extension method from io.worxbend.tui.dsl

Layout constraints — how much space the element claims inside its container.

Layout constraints — how much space the element claims inside its container.

Attributes

def onKey(keys: KeyEvent*)(handler: => Unit): Element
Extension method from io.worxbend.tui.dsl

Ergonomic key handlers that hide the true/false stop-propagation ceremony.

Ergonomic key handlers that hide the true/false stop-propagation ceremony.

onKey binds an action to one or more keys; it consumes the event only when a bound key matches, delegating anything else to a handler already on the element — so several .onKey(…) calls compose instead of overwriting each other. Use Element.onKeyEvent directly when a handler needs the raw event or conditional consumption.

Attributes

def onKeyEvent(handler: KeyEvent => Boolean): Element
Extension method from io.worxbend.tui.dsl

A handler returning true consumes the event; false lets it continue to the next candidate.

A handler returning true consumes the event; false lets it continue to the next candidate.

Attributes

def onMouseEvent(handler: MouseEvent => Boolean): Element
Extension method from io.worxbend.tui.dsl

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

def percent(pct: Int): Element
Extension method from io.worxbend.tui.dsl

Layout constraints — how much space the element claims inside its container.

Layout constraints — how much space the element claims inside its container.

Attributes

Extension method from io.worxbend.tui.dsl

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

Extension method from io.worxbend.tui.dsl

Rounded borders — meaningful on panels, identity elsewhere.

Rounded borders — meaningful on panels, identity elsewhere.

Attributes

Extension method from io.worxbend.tui.dsl

Row/Column flex alignment and inter-child spacing. flex/center/spaceBetween/… only bite on row/column containers whose children leave leftover space (no fill child); elsewhere they are the identity.

Row/Column flex alignment and inter-child spacing. flex/center/spaceBetween/… only bite on row/column containers whose children leave leftover space (no fill child); elsewhere they are the identity.

Attributes

Extension method from io.worxbend.tui.dsl

Row/Column flex alignment and inter-child spacing. flex/center/spaceBetween/… only bite on row/column containers whose children leave leftover space (no fill child); elsewhere they are the identity.

Row/Column flex alignment and inter-child spacing. flex/center/spaceBetween/… only bite on row/column containers whose children leave leftover space (no fill child); elsewhere they are the identity.

Attributes

Extension method from io.worxbend.tui.dsl

Row/Column flex alignment and inter-child spacing. flex/center/spaceBetween/… only bite on row/column containers whose children leave leftover space (no fill child); elsewhere they are the identity.

Row/Column flex alignment and inter-child spacing. flex/center/spaceBetween/… only bite on row/column containers whose children leave leftover space (no fill child); elsewhere they are the identity.

Attributes

def style: Style
def styled(transform: Style => Style): Element
Extension method from io.worxbend.tui.dsl

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

Extension method from io.worxbend.tui.dsl

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes