View Source ElementTui (ElementTui v0.4.0)

Main interface to the ElementTui library, for running a terminal user interface (TUI). Functions in this module allow parsing elements and rendering them to the screen. The function ElementTui.run_loop/3 is a good starting point for running a TUI loop.

To see the type of elements that can be rendered, check the ElementTui.Element module documentation and struct. Also check the examples repository: https://codeberg.org/edwinvanl/elementtui_examples

Summary

Functions

Clear the terminal

The height of the terminal

Draw the content to the terminal

Render the passed elements to a window starting at column x and row y, with total width and height

Create a loop for your TUI. Allows passing along state and a function. The function will be called with the state and the event.

The width of the terminal

Functions

Clear the terminal

The height of the terminal

Draw the content to the terminal

Link to this function

render(elements, x, y, width, height, opts \\ [])

View Source

Render the passed elements to a window starting at column x and row y, with total width and height

Will clear the region before rendering.

Link to this function

run_loop(render_function, state, opts \\ [])

View Source

Create a loop for your TUI. Allows passing along state and a function. The function will be called with the state and the event.

Also possible to pass a timeout, which will be used for polling.

The width of the terminal