API Reference tuix v#0.1.4

Copy Markdown View Source

Modules

Tuix is a terminal UI framework for Elixir, inspired by OpenTUI.

The behaviour for Tuix applications, modeled after Phoenix LiveView.

A 2D grid of Tuix.Cells representing one terminal frame.

A single terminal cell: one grapheme plus its styling.

Color parsing and SGR code generation.

The behaviour for focusable, stateful element kinds (input, select, scroll_box).

Functions and macros for building the element tree returned by Tuix.App.render/1.

The editing core of the Tuix.Components.input/1 element: pure, grapheme-aware functions over a value and a cursor offset.

The behaviour implementation and pure helpers behind Tuix.Components.scroll_box/2, a focusable, vertically scrolling container.

The behaviour implementation and pure helpers behind Tuix.Components.select/1, a vertical list picker.

A node in the declarative UI tree.

Events delivered to a Tuix.App's Tuix.App.handle_event/2 callback.

Delivered when focus moves — via Tab traversal or programmatically with Tuix.App.focus/2 / Tuix.App.blur/1.

Delivered when a focused input's value changes.

A keyboard event.

A terminal resize event.

Delivered when a focused select's selection moves (selects are controlled and the selection follows the highlight, so :up / :down emit this immediately).

Keyboard focus: which element receives targeted input.

Reads raw bytes from stdin in a blocking loop and sends parsed key events to the runtime as {:tuix_input, %Tuix.Event.Key{}} messages.

Incremental parser turning raw terminal input bytes into Tuix.Event.Key structs.

Flexbox-subset layout engine.

An element resolved to an absolute rectangle.

Paints a placed element tree into a Tuix.Buffer and serializes frames (or frame diffs) into ANSI iodata.

The event loop: holds the Tuix.App state, dispatches input and resize events to the app's callbacks, manages keyboard focus (Tab / Shift+Tab traversal over focusable elements), routes keys to the focused component element (see Tuix.Component), and re-renders after every state change.

Owns the terminal: switches it into raw mode and the alternate screen on start, and restores it on shutdown — including crash shutdowns.

Builders for the ANSI escape sequences on the frame-rendering hot path.

Renders element trees (or whole apps) to buffers and text snapshots without touching the terminal. The Tuix analog of OpenTUI's createTestRenderer.