elui/demo.exs

Immediate-mode terminal UIs for Elixir

Build TUIs that feel native to the BEAM.

Elui brings Ratatui-shaped rendering, layout, input, and widgets to Elixir, with an app loop that plays nicely with supervisors, GenServers, messages, and long-running systems.

36
runnable examples
OTP
message-driven loop
Test
backend snapshots

Rebuild the interface from state, render into a buffer, and let Elui flush the diff. Use it for developer tools, operational dashboards, terminal workbenches, and live OTP experiments.

Why Elui

Ratatui ideas, Elixir instincts.

Elui keeps the immediate-mode model clear while letting your runtime stay unmistakably Elixir: processes talk, widgets render, tests assert on buffers.

01

Immediate frames

Compose each frame from current state with `Elui.Terminal` and `Elui.Frame`; the backend writes only changed cells.

02

OTP-friendly events

`Elui.App` handles keys, mouse events, ticks, terminal resizes, and arbitrary process messages in one model update function.

03

Widgets with shape

Blocks, paragraphs, lists, tables, tabs, gauges, charts, canvas, calendars, scrollbars, sparklines, and bar charts.

04

Assertable output

Render with `Elui.Backend.Test` and assert on plain lines without needing a real terminal in CI.

Examples

Thirty-six examples. All running for real.

Every clip launches the checked-in `.exs` file through Elui in a real terminal. The gallery spans complete apps, individual widgets, layout tools, and BEAM runtime experiments.

36 examples

Install

Install from GitHub.

def deps do
  [
    {:elui, github: "douglascorrea/elui"}
  ]
end
mix deps.get
mix run examples/demo.exs
Mental model

Ratatui vocabulary, Elixir modules.

Terminal / FrameElui.Terminal / Elui.Frame
Buffer / CellElui.Buffer / Cell
Layout / ConstraintElui.Layout
Widget traitElui.Widget protocol
EventsElui.Input + Elui.App
Test backendElui.Backend.Test