io.worxbend.tui.dsl

Members list

Type members

Classlikes

enum Align

Where a fixed-size block sits inside a larger area along one axis.

Where a fixed-size block sits inside a larger area along one axis.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class AnimatedTextElement(content: String, elapsed: FiniteDuration, effect: TextEffect, baseStyle: Style, highlightStyle: Style, props: ElementProps) extends Element

Text carrying a time-based effect, themed at construction.

Text carrying a time-based effect, themed at construction.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all

The ambient time source the animated elements read, so showing a spinner needs no tick plumbing at all.

The ambient time source the animated elements read, so showing a spinner needs no tick plumbing at all.

Before this existed, an animation cost four separate steps: set a tickRate, declare a Signal[Int], override onTick to advance it, and thread the counter through every call site. All four were boilerplate the framework already had the information to do itself.

Reading it is a tracked read, which is what makes this work rather than merely shorten: a view only subscribes to the clock when it actually renders an animation, so a screen with no spinner on it is not woken up by the ticks — where a hand-rolled ticks.get in the view repaints the whole app forever whether anything is moving or not.

The value is elapsed time since the process started rather than since a particular runner, so it is meaningful without a runner (a plain unit test reads Duration.Zero until something advances it) and consistent across several runners in one JVM.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
final case class AutocompleteElement(state: AutocompleteState, suggestions: Seq[String], onAccept: String => Unit, maxSuggestions: Int, props: ElementProps) extends Element

A text input with a live suggestion dropdown: typing filters suggestions (subsequence match), Up/Down move the highlight, Enter accepts it into the input and fires onAccept.

A text input with a live suggestion dropdown: typing filters suggestions (subsequence match), Up/Down move the highlight, Enter accepts it into the input and fires onAccept.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final class AutocompleteState

App-owned state for an autocomplete element: the text being typed plus the highlighted suggestion.

App-owned state for an autocomplete element: the text being typed plus the highlighted suggestion.

Attributes

Supertypes
class Object
trait Matchable
class Any
final case class BadgeElement(label: String, variant: BadgeVariant, badgeStyle: Style, props: ElementProps) extends Element

A short inline label, themed at construction.

A short inline label, themed at construction.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
enum Breakpoint

A coarse width band for a terminal, the vocabulary Element.responsive and TuiApp.breakpoint branch on.

A coarse width band for a terminal, the vocabulary Element.responsive and TuiApp.breakpoint branch on.

Bands are width-only and cumulative: Medium means "at least 80 columns", not "exactly 80 to 119". Height is left out deliberately — a Size => Element builder still sees both axes, and short-but-wide terminals want a different decision than narrow ones, so folding both into one band would hide the distinction rather than name it.

The thresholds are the ones terminals actually cluster around: 80 columns is the historical default, 120 the common width of a maximized modern window, and anything under 60 is a split pane or a phone-sized SSH session.

Attributes

Companion
object
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Breakpoint

Attributes

Companion
enum
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Breakpoint.type
final case class ButtonElement(label: String, action: () => Unit, props: ElementProps) extends Element

A pressable button: Enter or Space triggers action while focused.

A pressable button: Enter or Space triggers action while focused.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class CheckboxElement(label: String, checked: Signal[Boolean], props: ElementProps) extends Element

A labelled checkbox over a caller-owned Signal. Space/Enter (or a click) flips it while focused.

A labelled checkbox over a caller-owned Signal. Space/Enter (or a click) flips it while focused.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class CollapsibleElement(title: String, body: Element, expanded: Signal[Boolean], props: ElementProps) extends Element

A toggleable section: ▸ title collapsed, ▾ title plus the body expanded; Enter/Space toggle while focused. Collapsed bodies leave the tab order entirely.

A toggleable section: ▸ title collapsed, ▾ title plus the body expanded; Enter/Space toggle while focused. Collapsed bodies leave the tab order entirely.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class ColumnElement(children: Seq[Element], spacing: Int, flex: Flex, props: ElementProps) extends Element

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class DataTableElement(table: DataTable, state: DataTableState, props: ElementProps) extends Element

A sortable, filterable table. Up/Down move the row selection while focused, and PageUp/PageDown turn the page once state.pageSize is set (they are left unconsumed otherwise, so they keep bubbling). Sorting and filtering have no built-in keys — drive state.sortBy/state.setFilter from the app's own bindings.

A sortable, filterable table. Up/Down move the row selection while focused, and PageUp/PageDown turn the page once state.pageSize is set (they are left unconsumed otherwise, so they keep bubbling). Sorting and filtering have no built-in keys — drive state.sortBy/state.setFilter from the app's own bindings.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class DirectoryTreeElement(state: DirectoryTreeState, props: ElementProps) extends Element

A filesystem browser. Up/Down move the selection, Enter expands or collapses the selected directory, while focused. Listings are read lazily and cached in state — it touches the disk on expansion, never per frame.

A filesystem browser. Up/Down move the selection, Enter expands or collapses the selected directory, while focused. Listings are read lazily and cached in state — it touches the disk on expansion, never per frame.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
sealed trait Element

A node of the retained-mode UI tree.

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
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Element

The factory set: one obvious home, re-exported at the package top level so import io.worxbend.tui.dsl.* brings every factory in.

The factory set: one obvious home, re-exported at the package top level so import io.worxbend.tui.dsl.* brings every factory in.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Element.type
final case class ElementProps(style: Style, constraint: Option[Constraint], onKey: Option[KeyEvent => Boolean], onMouse: Option[MouseEvent => Boolean], focusable: Boolean, focused: Boolean, focusKey: Option[String], focusStyle: Style, inert: Boolean)

The cross-cutting properties every Element carries: its style, an optional layout constraint (how much space it claims inside a row/column/panel), its event handlers, and focus participation. Styling and layout extension methods produce a new element with updated props — elements stay immutable values.

The cross-cutting properties every Element carries: its style, an optional layout constraint (how much space it claims inside a row/column/panel), its event handlers, and focus participation. Styling and layout extension methods produce a new element with updated props — elements stay immutable values.

focusable opts the element into tab-order traversal; focused is set by the framework's focus pass each render, never by user code. inert marks a subtree a modal layer covers: it takes no key and no mouse event at all and supplies no focus or hit-test path. Like focused, the framework's passes set it each render, never user code.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class FilePickerElement(state: FilePickerState, props: ElementProps) extends Element

A file chooser over a FilePickerState: arrows navigate, Enter opens directories or accepts a file into state.chosen.

A file chooser over a FilePickerState: arrows navigate, Enter opens directories or accepts a file into state.chosen.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final class FilePickerState(root: Path)

App-owned state for a filePicker: the directory tree plus the accepted file.

App-owned state for a filePicker: the directory tree plus the accepted file.

Attributes

Supertypes
class Object
trait Matchable
class Any
final case class FilledElement(inner: Element, fill: Style, props: ElementProps) extends Element

Fills its whole area with fill (a solid background) before rendering inner — what the chrome bars use to read as continuous surfaces. Transparent to focus and event routing.

Fills its whole area with fill (a solid background) before rendering inner — what the chrome bars use to read as continuous surfaces. Transparent to focus and event routing.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
object Form

Renders a FormState as labeled controls with inline validation errors — the Tier 2 Form widget, composed from input/checkbox so it inherits focus traversal for free.

Renders a FormState as labeled controls with inline validation errors — the Tier 2 Form widget, composed from input/checkbox so it inherits focus traversal for free.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Form.type
final class FormState[A]

Live state for a compile-time-derived form: text/int fields become inputs, boolean fields become checkboxes; submit runs each field's parser/validators — errors land in errors per field, a fully valid form lands in result.

Live state for a compile-time-derived form: text/int fields become inputs, boolean fields become checkboxes; submit runs each field's parser/validators — errors land in errors per field, a fully valid form lands in result.

Custom validation attaches per field name via cue4s-style Field composition: FormState.of(deriveForm[Signup], Field.int("age").mapValidated(...)).

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object FormState

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
FormState.type
final case class GaugeElement(ratio: Double, label: Option[String], props: ElementProps) extends Element

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class IndeterminateElement(elapsed: FiniteDuration, motion: IndeterminateMotion, bar: ProgressStyle, trackStyle: Style, fillStyle: Style, period: FiniteDuration, props: ElementProps) extends Element

A one-row indeterminate progress bar, themed at construction.

A one-row indeterminate progress bar, themed at construction.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class InputElement(state: TextInputState, placeholder: String, props: ElementProps) extends Element

Single-line text input. Editing state (value + cursor) is app-owned; editing keys are handled by the built-in handler while focused, and any consumed key triggers a redraw.

Single-line text input. Editing state (value + cursor) is app-owned; editing keys are handled by the built-in handler while focused, and any consumed key triggers a redraw.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
object Key

Named key constants and constructors, so handlers read onKey(Key.Up){ … } instead of matching raw KeyEvent(KeyCode.Up, _). Mirrors terminus's Key.up / Key.controlQ vocabulary.

Named key constants and constructors, so handlers read onKey(Key.Up){ … } instead of matching raw KeyEvent(KeyCode.Up, _). Mirrors terminus's Key.up / Key.controlQ vocabulary.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Key.type
final case class KeyBinding(trigger: KeyEvent, label: String, description: String, action: () => Unit, showInHints: Boolean)

One declared application key: the trigger, the short label shown in status-bar hints, a description for the help overlay, and the action.

One declared application key: the trigger, the short label shown in status-bar hints, a description for the help overlay, and the action.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final class KeyBindings

The application's declared keys (bubbles' key+help pattern): one declaration drives dispatch, the status-bar hints, and the help overlay. TuiApp consults these for events no element consumed.

The application's declared keys (bubbles' key+help pattern): one declaration drives dispatch, the status-bar hints, and the help overlay. TuiApp consults these for events no element consumed.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object KeyBindings

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
final case class LayersElement(children: Seq[Element], props: ElementProps) extends Element

Z-ordered stacking: every child renders over the full area in order, so later children paint over earlier ones — the primitive under dialogs, toasts, palettes, and splash overlays.

Z-ordered stacking: every child renders over the full area in order, so later children paint over earlier ones — the primitive under dialogs, toasts, palettes, and splash overlays.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class LinearSpinnerElement(elapsed: FiniteDuration, railStyle: Style, headStyle: Style, axis: LinearAxis, path: LinearPath, flow: LinearFlow, trail: LinearTrail, period: FiniteDuration, props: ElementProps) extends Element

A head travelling a one-cell track, themed at construction.

A head travelling a one-cell track, themed at construction.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class ListElement(items: Seq[String], state: ListState, props: ElementProps) extends Element

A scrollable single-selection list. Up/Down move the selection while focused, the wheel does the same on hover; the widget scrolls to keep the selection visible. state is caller-owned, so the app can read or set the selection.

A scrollable single-selection list. Up/Down move the selection while focused, the wheel does the same on hover; the widget scrolls to keep the selection visible. state is caller-owned, so the app can read or set the selection.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class LoadingTheme(spinner: Style, label: Style, track: Style, fill: Style, band: Style, fillRamp: Option[ColorRamp])

The styles the loading and progress animations draw from.

The styles the loading and progress animations draw from.

Split out of Theme rather than flattened into it because these five travel together: retheming a progress bar means changing track and fill consistently, and a theme that got one of them wrong would be hard to spot. It also keeps Theme's own vocabulary semantic (accent, muted) rather than widget-specific.

fillRamp is optional because a color ramp is a deliberate choice, not a default: a bar that walks red-to-green reads as "danger receding", which is right for disk usage and wrong for a download. Themes leave it unset and a call site opts in with .ramp(...).

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object LoadingTheme

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class LogElement(state: LogState, props: ElementProps) extends Element

A scrollable log panel: Up/Down (and PageUp/PageDown) scroll while focused; the tail re-follows when scrolled back to the bottom.

A scrollable log panel: Up/Down (and PageUp/PageDown) scroll while focused; the tail re-follows when scrolled back to the bottom.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class MaskedInputElement(state: TextInputState, mask: String, props: ElementProps) extends Element

A template-driven input (##/##/####): # accepts a digit, A a letter, literals insert themselves.

A template-driven input (##/##/####): # accepts a digit, A a letter, literals insert themselves.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class MenuElement(items: Seq[MenuItem], state: MenuState, onSelect: Int => Unit, props: ElementProps) extends Element

A vertical menu / dropdown / context menu popup. Up/Down move the highlight (skipping separators and disabled items), Enter (or a click) fires onSelect with the chosen index, the wheel scrolls. Escape is left unconsumed so an enclosing app can close it.

A vertical menu / dropdown / context menu popup. Up/Down move the highlight (skipping separators and disabled items), Enter (or a click) fires onSelect with the chosen index, the wheel scrolls. Escape is left unconsumed so an enclosing app can close it.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class NoticeElement(message: String, level: NoticeLevel, timestamp: Option[LocalTime], messageStyle: Style, accentStyle: Style, timestampStyle: Style, wrap: Boolean, props: ElementProps) extends Element

One styled message line, themed at construction.

One styled message line, themed at construction.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class NumberInputElement(state: TextInputState, allowDecimal: Boolean, props: ElementProps) extends Element

A text input restricted to numbers (optional single leading minus and, with allowDecimal, one dot).

A text input restricted to numbers (optional single leading minus and, with allowDecimal, one dot).

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class OrbitSpinnerElement(elapsed: FiniteDuration, pathStyle: Style, arcStyle: Style, orbit: OrbitPath, trail: OrbitTrail, sweep: Double, radius: Option[Int], thickness: Int, resolution: CanvasResolution, marker: String, direction: SpinDirection, period: FiniteDuration, props: ElementProps) extends Element

An orbit spinner whose colors were resolved from the ambient Theme at construction.

An orbit spinner whose colors were resolved from the ambient Theme at construction.

The LoadingTheme supplies both: the resting path takes track, the arc takes spinner. Anything the call site sets with .color/.bold/.style layers onto the arc only, so orbitSpinner().color(Color.Red) recolors the moving part and leaves the path themed — the rule SpinnerElement follows for its glyph and label.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class PaginatorElement(current: Signal[Int], total: Int, props: ElementProps) extends Element

A page indicator: Left/Right change the page while focused.

A page indicator: Left/Right change the page while focused.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class PanelElement(title: Option[String], children: Seq[Element], borderType: BorderType, props: ElementProps) extends Element

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class PositionedElement(dx: Int, dy: Int, width: Int, height: Int, content: Element, props: ElementProps) extends Element

Renders content at an absolute offset inside whatever area it is given, sized width x height (clipped to the area). The building block for context menus and tooltips anchored at a mouse or widget position — compose it over a base with Element.layers.

Renders content at an absolute offset inside whatever area it is given, sized width x height (clipped to the area). The building block for context menus and tooltips anchored at a mouse or widget position — compose it over a base with Element.layers.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class ProgressBarElement(ratio: Double, label: ProgressLabel, bar: ProgressStyle, trackStyle: Style, fillStyle: Style, ramp: Option[ColorRamp], props: ElementProps) extends Element

A one-row determinate progress bar, themed at construction.

A one-row determinate progress bar, themed at construction.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class RadioGroupElement(options: Seq[String], selected: Signal[Int], props: ElementProps) extends Element

Mutually exclusive options: Up/Down move the selection while focused.

Mutually exclusive options: Up/Down move the selection while focused.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class ResponsiveElement(build: Size => Element, resolved: Option[Element], props: ElementProps) extends Element

A subtree chosen by the terminal's size — a media query, not a container query.

A subtree chosen by the terminal's size — a media query, not a container query.

build is handed the size of the whole terminal, not this node's allotted area, and runs during ResponsivePass before the focus pass, so whatever it returns is an ordinary part of the tree: its focusables take Tab stops, its handlers receive keys, and clicks hit-test into it — unless the node sits on a layer a modal covers, in which case ResponsivePass suppresses the branch along with the rest of that layer. That is what makes swapping components work and not just constraints — a row of three panes at 120 columns can become a tabbedContent at 60.

The node is otherwise transparent: it holds the built branch as its single child, so a constraint, a style, or an onKeyEvent set on it applies exactly as it would on a column wrapping the same content, and the branch's own layout claim becomes the node's when none is set explicitly.

resolved is filled in by ResponsivePass on every render, never by user code — the same contract ElementProps.focused has. While it is empty the node still renders: it falls back to building against its own area, so a construction test that draws element.widget straight into a buffer without a TuiApp behind it shows content rather than blank space. That fallback has no focus pass behind it, so focusables inside it are inert — which is why the pass exists rather than doing this at render time.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class RowElement(children: Seq[Element], spacing: Int, flex: Flex, props: ElementProps) extends Element

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
trait Screen

One entry of the app's screen stack.

One entry of the app's screen stack.

A modal screen renders layered over what's beneath it, with everything below removed from the tab order; a full screen replaces the view entirely. Push/pop via TuiApp.pushScreen/popScreen.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Screen

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Screen.type
final case class ScrollViewElement(content: Element, contentHeight: Int, state: ScrollViewState, props: ElementProps) extends Element

A scrollable viewport over taller-than-the-screen content. Up/Down/PageUp/PageDown scroll while focused.

A scrollable viewport over taller-than-the-screen content. Up/Down/PageUp/PageDown scroll while focused.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class SelectElement(options: Seq[String], selected: Signal[Int], props: ElementProps) extends Element

A one-row option cycler. Left/Right step through options while focused (wrapping at both ends) and a click advances one; the selection is an index into options, so it survives nothing but a stable option list.

A one-row option cycler. Left/Right step through options while focused (wrapping at both ends) and a click advances one; the selection is an index into options, so it survives nothing but a stable option list.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class SelectionListElement(items: Seq[String], selected: Signal[Set[Int]], state: ListState, props: ElementProps) extends Element

A multi-select list: Up/Down move the cursor, Space toggles membership of the cursor row.

A multi-select list: Up/Down move the cursor, Space toggles membership of the cursor row.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class Sidebar(content: Element, width: Int, onRight: Boolean)

Sidebar configuration for scaffold.

Sidebar configuration for scaffold.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class SkeletonElement(elapsed: FiniteDuration, baseStyle: Style, bandStyle: Style, bandWidth: Option[Int], period: FiniteDuration, props: ElementProps) extends Element

A skeleton placeholder, themed at construction.

A skeleton placeholder, themed at construction.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class SliderElement(value: Signal[Int], min: Int, max: Int, step: Int, props: ElementProps) extends Element

A value slider: Left/Right adjust by step, Home/End jump to the bounds, while focused.

A value slider: Left/Right adjust by step, Home/End jump to the bounds, while focused.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class SpacerElement(props: ElementProps) extends Element

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class SparklineElement(data: Seq[Long], max: Option[Long], props: ElementProps) extends Element

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class SpinnerElement(elapsed: FiniteDuration, label: String, preset: SpinnerPreset, glyphStyle: Style, labelStyle: Style, props: ElementProps) extends Element

A spinner whose colors were resolved from the ambient Theme at construction.

A spinner whose colors were resolved from the ambient Theme at construction.

The theme supplies the glyph and label styles; anything the call site sets with .color/.bold/.style layers on top of the glyph style, so spinner(tick).color(Color.Red) recolors the moving part and leaves the label alone.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class SpinnerGridElement(elapsed: FiniteDuration, preset: SpinnerPreset, phase: GridPhase, glyphStyle: Style, ramp: Option[ColorRamp], props: ElementProps) extends Element

A themed block of phase-offset spinners.

A themed block of phase-offset spinners.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class SplashScreen(content: Element, effect: Effect, minimumDuration: FiniteDuration)

An intro shown before the first view render: content (typically a bigText logo composition) plays effect and holds for at least minimumDuration; any key skips it. Wire via TuiApp.splash.

An intro shown before the first view render: content (typically a bigText logo composition) plays effect and holds for at least minimumDuration; any key skips it. Wire via TuiApp.splash.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class SplitPaneElement(first: Element, second: Element, splitPercent: Signal[Int], horizontal: Boolean, props: ElementProps) extends Element

Two panes split by an adjustable divider: [/] shift the split while the pane itself is focused.

Two panes split by an adjustable divider: [/] shift the split while the pane itself is focused.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class TabbedContentElement(titles: Seq[String], activePage: Element, selected: Signal[Int], pageCount: Int, props: ElementProps) extends Element

A tab row plus the selected page (Textual's TabbedContent): Left/Right switch pages while focused. Only the active page's focusables participate in the tab order.

A tab row plus the selected page (Textual's TabbedContent): Left/Right switch pages while focused. Only the active page's focusables participate in the tab order.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class TableElement(rows: Seq[Seq[String]], widths: Seq[Constraint], header: Option[Seq[String]], props: ElementProps) extends Element

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class TabsElement(titles: Seq[String], selected: Int, props: ElementProps) extends Element

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class TextAreaElement(state: TextAreaState, props: ElementProps) extends Element

Multi-line editor element. While focused it consumes printable characters, Enter (newline), Backspace, Delete, arrows, Home/End, Ctrl+Z (undo) and Ctrl+Y (redo) — Tab stays free for focus traversal. A bracketed paste lands as one edit, with carriage returns stripped.

Multi-line editor element. While focused it consumes printable characters, Enter (newline), Backspace, Delete, arrows, Home/End, Ctrl+Z (undo) and Ctrl+Y (redo) — Tab stays free for focus traversal. A bracketed paste lands as one edit, with carriage returns stripped.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class TextElement(content: String, props: ElementProps) extends Element

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class Theme(name: String, primary: Style, accent: Style, muted: Style, error: Style, warning: Style, success: Style, surface: Style, border: Style, focus: Style, loading: LoadingTheme)

Semantic styles the chrome presets (and applications) draw from, provided ambiently via given Theme.

Semantic styles the chrome presets (and applications) draw from, provided ambiently via given Theme.

The default is Theme.Dark; an application overrides it by defining its own given (or by rendering from a Signal[Theme] for runtime switching — the view re-evaluates, presets pick up the new value).

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Theme

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Theme.type
final case class ToggleElement(label: String, on: Signal[Boolean], props: ElementProps) extends Element

A labelled on/off switch — a CheckboxElement in switch clothing, with the same Space/Enter/click activation.

A labelled on/off switch — a CheckboxElement in switch clothing, with the same Space/Enter/click activation.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
final case class TreeElement(nodes: Seq[TreeNode], state: TreeState, props: ElementProps) extends Element

A collapsible tree over an in-memory node list. Up/Down move the selection through the visible rows and Enter expands or collapses the selected branch (a no-op on a leaf), all while focused.

A collapsible tree over an in-memory node list. Up/Down move the selection through the visible rows and Enter expands or collapses the selected branch (a no-op on a leaf), all while focused.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all
trait TuiApp

The application entry point for the declarative DSL.

The application entry point for the declarative DSL.

view is re-evaluated under a tracking ReactiveScope: any Signal read during the last evaluation schedules a redraw when it changes — state lives in signals, not in an explicitly threaded State value.

Focus and events: focusable elements form a tab order in depth-first view order; Tab / Shift+Tab cycle focus and a mouse press focuses the innermost focusable under the pointer. Key events start at the focused element and bubble to its ancestors (true consumes), then the app's bindings run; an unconsumed Ctrl+P opens the command palette (when bindings exist) and Ctrl+C quits.

App services: pushScreen/popScreen for modal or full-screen navigation (layers below a modal leave the tab order), notify for tick-aged toasts, openPalette for the fuzzy command palette over the declared bindings. Call quit from any handler to exit cleanly.

Attributes

Supertypes
class Object
trait Matchable
class Any
final case class WidgetElement(wrapped: Widget, props: ElementProps, measure: Int => Option[Int]) extends Element

Escape hatch: any core Widget as a leaf element (its rendering ignores the element style). measure lets width-dependent content (wrapped markdown, images) report its height to the measurement pass.

Escape hatch: any core Widget as a leaf element (its rendering ignores the element style). measure lets width-dependent content (wrapped markdown, images) report its height to the measurement pass.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Element
class Object
trait Matchable
class Any
Show all

Types

The shape of an app's view (and any sub-view helper): a computation, run under a tracking ReactiveScope, that produces the current Element tree. Reading a Signal inside it subscribes the next redraw. Mirrors terminus's type Program[A] = Terminal ?=> A — one named shape every view has.

The shape of an app's view (and any sub-view helper): a computation, run under a tracking ReactiveScope, that produces the current Element tree. Reading a Signal inside it subscribes the next redraw. Mirrors terminus's type Program[A] = Terminal ?=> A — one named shape every view has.

Attributes

Value members

Concrete methods

def binding(key: String, description: String)(action: => Unit): KeyBinding

Declares one binding from a key spec string: "q", "ctrl+s", "shift+tab", "esc", "f2", "up", "+"… A malformed spec is a programmer error and throws at construction (bindings are static app declarations).

Declares one binding from a key spec string: "q", "ctrl+s", "shift+tab", "esc", "f2", "up", "+"… A malformed spec is a programmer error and throws at construction (bindings are static app declarations).

Attributes

def centered(width: Int, height: Int)(content: Element): Element

content at a fixed size, centered both ways in whatever space is available.

content at a fixed size, centered both ways in whatever space is available.

Attributes

def helpOverlay(bindings: KeyBindings, title: String)(using theme: Theme): Element

A centered help dialog listing every hinted binding — render it last (over the view) while visible.

A centered help dialog listing every hinted binding — render it last (over the view) while visible.

Attributes

def masterDetail(master: Element, detail: Element, masterWidth: Int): Element

The classic list-left, detail-right split.

The classic list-left, detail-right split.

Attributes

def place(width: Int, height: Int, horizontal: Align, vertical: Align, fill: Option[Style])(content: Element): Element

Positions content (sized width x height) inside whatever area it is given, aligned horizontal x vertical (both Center by default — the centered case). Pass fill to paint the surrounding whitespace with a style (Lip Gloss Place-style), e.g. a dimmed backdrop behind a dialog.

Positions content (sized width x height) inside whatever area it is given, aligned horizontal x vertical (both Center by default — the centered case). Pass fill to paint the surrounding whitespace with a style (Lip Gloss Place-style), e.g. a dimmed backdrop behind a dialog.

Attributes

def scaffold(topBar: Option[Element], sidebar: Option[Sidebar], statusBar: Option[Element])(content: Element): Element

The application shell: optional top bar, optional sidebar (left or right of the content), the content filling the middle, and an optional status bar.

The application shell: optional top bar, optional sidebar (left or right of the content), the content filling the middle, and an optional status bar.

Attributes

def sidebarLayout(side: Element, main: Element, sideWidth: Int): Element

Side pane + main pane.

Side pane + main pane.

Attributes

def statusBar(hints: Seq[(String, String)])(using theme: Theme): Element

A one-row status bar of key description hints over the theme surface.

A one-row status bar of key description hints over the theme surface.

Attributes

def statusBar(bindings: KeyBindings)(using Theme): Element

Status bar fed directly from the app's declared KeyBindings.

Status bar fed directly from the app's declared KeyBindings.

Attributes

def topBar(title: String, tabs: Seq[String], selectedTab: Int, right: String)(using theme: Theme): Element

A one-row title bar over the theme surface: title left, optional tabs center, optional right-side text.

A one-row title bar over the theme surface: title left, optional tabs center, optional right-side text.

Attributes

def withStyle(transform: Style => Style)(inner: Element): Element

Pushes a default style onto a whole subtree (terminus's auto-restoring foreground.green { … }, as a retained transform): every style-aware descendant renders with transform(...) as its base, with any style the node set itself layered on top. Style-ignoring leaves (raw widget(...), images) are unaffected.

Pushes a default style onto a whole subtree (terminus's auto-restoring foreground.green { … }, as a retained transform): every style-aware descendant renders with transform(...) as its base, with any style the node set itself layered on top. Style-ignoring leaves (raw widget(...), images) are unaffected.

Attributes

Extensions

Extensions

extension (element: Element)
def onKey(keys: KeyEvent*)(handler: => Unit): Element

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

extension (element: Element)

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 flex(mode: Flex): Element

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

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 gap(cells: Int): Element

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

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

Attributes

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

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

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 (element: Element)

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

def bold: Element

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

def color(c: Color): Element

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

def dim: Element

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

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

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

Attributes

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

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

def key(name: String): Element

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 onKeyEvent(handler: KeyEvent => Boolean): Element

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

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

Rounded borders — meaningful on panels, identity elsewhere.

Rounded borders — meaningful on panels, identity elsewhere.

Attributes

def styled(transform: Style => Style): Element

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

Fluent styling — each call returns a new element.

Fluent styling — each call returns a new element.

Attributes

extension (element: Element)
def fill: Element

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

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

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

Attributes

def length(cells: Int): Element

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

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

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

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

Attributes

def percent(pct: Int): Element

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

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

Attributes

Exports

Defined exports

final val Async: Async
Exported from runtime
final type BadgeVariant = BadgeVariant
Exported from widgets
final val Cancelable: Cancelable
Exported from runtime
final type Cancelable = Cancelable
Exported from runtime
final val Color: Color
Exported from core
final type Color = Color
Exported from core
final val ColorRamp: ColorRamp
Exported from widgets
final type ColorRamp = ColorRamp
Exported from widgets
final val Computed: Computed
Exported from runtime
final type Computed = Computed
Exported from runtime
final val Constraint: Constraint
Exported from core
final type Constraint = Constraint
Exported from core
final val Derived: Derived
Exported from runtime
final type Derived = Derived
Exported from runtime
final val Easing: Easing
Exported from runtime
final type Easing = Easing
Exported from runtime
final val Effect: Effect
Exported from runtime
final type Effect = Effect
Exported from runtime
final type Flex = Flex
Exported from core
final type GridPhase = GridPhase
Exported from widgets
final type IndeterminateMotion = IndeterminateMotion
Exported from widgets
final type KeyCode = KeyCode
Exported from core
final val KeyEvent: KeyEvent
Exported from core
final type KeyEvent = KeyEvent
Exported from core
final val KeyModifiers: KeyModifiers
Exported from KeyModifiers$package
final type KeyModifiers = KeyModifiers
Exported from KeyModifiers$package$
final val Language: Language
Exported from widgets
final type Language = Language
Exported from widgets
final type LinearAxis = LinearAxis
Exported from widgets
final type LinearFlow = LinearFlow
Exported from widgets
final type LinearPath = LinearPath
Exported from widgets
final type LinearTrail = LinearTrail
Exported from widgets
final type MouseEvent = MouseEvent
Exported from core
final type NoticeLevel = NoticeLevel
Exported from widgets
final type OrbitPath = OrbitPath
Exported from widgets
final type OrbitTrail = OrbitTrail
Exported from widgets
final type ProgressLabel = ProgressLabel
Exported from widgets
final val ProgressStyle: ProgressStyle
Exported from widgets
final type ProgressStyle = ProgressStyle
Exported from widgets
final val ReactiveScope: ReactiveScope
Exported from runtime
final type ReactiveScope = ReactiveScope
Exported from runtime
final val Signal: Signal
Exported from runtime
final type Signal = Signal
Exported from runtime
final type Size = Size
Exported from core
final val SpinnerPreset: SpinnerPreset
Exported from widgets
final type SpinnerPreset = SpinnerPreset
Exported from widgets
final val Style: Style
Exported from core
final type Style = Style
Exported from core
final val SyntaxHighlighter: SyntaxHighlighter
Exported from widgets
final type SyntaxTheme = SyntaxTheme
Exported from widgets
final type TextEffect = TextEffect
Exported from widgets
final type Tween = Tween
Exported from runtime
Exported from Element

Flexible blank space (fills what siblings leave over).

Flexible blank space (fills what siblings leave over).

Attributes