Breeze logo

Elixir terminal UI

Breeze

A TUI library with a LiveView-inspired API for building Elixir terminal applications without third-party NIFs.

mix run examples/counter.exs

Install

Get Started

Breeze ships its own template runtime and formatter for `~H` terminal templates, so you can keep a familiar Elixir workflow.

mix.exs
def deps do
  [
    {:breeze, "~> 0.5.1"}
  ]
end
elixir counter.exs
Mix.install([{:breeze, "~> 0.5.1"}])

defmodule Demo do
  use Breeze.View

  def mount(_opts, term) do
    {:ok, assign(term, counter: 0)}
  end

  def render(assigns) do
    ~H"""
    <box style="w-screen h-screen bg">
      <box style="text-primary bold">Breeze counter</box>
      <box style="text-accent bold">Counter: {@counter}</box>
    </box>
    """
  end

  def handle_event(_, %{"key" => "ArrowUp"}, term) do
    {:noreply,
      assign(term, counter: term.assigns.counter + 1)}
  end

  def handle_event(_, %{"key" => "ArrowDown"}, term) do
    {:noreply,
      assign(term, counter: term.assigns.counter - 1)}
  end
end

Breeze.Example.run(view: Demo)
interactive counter ArrowUp / ArrowDown count ยท t theme

Features

LiveView-shaped primitives for the terminal

LiveView style API

Build terminal views with mount/2, render/1, handle_event/3, assigns, function components, attributes, and slots.

Breeze templates

Use Breeze's own ~H sigil and template runtime with familiar HEEx-style assigns, loops, conditionals, and slots.

Scrollable viewports

Add scroll_y, scroll_x, or scroll modifiers to terminal regions that need stable keyboard-driven navigation.

Built-in blocks

Reach for list, dropdown, tabs, markdown, scroll, panel, modal, and table blocks instead of rebuilding common TUI patterns.

Terminal-native foundation

Breeze is built on Termite and BackBreeze, keeping the rendering model focused on real terminal applications.

Deterministic testing

Exercise views with Breeze.Test, render fixed terminal sizes, dispatch input, and assert terminal output.

Built for iteration

Developer Tooling

Remote inspector

Inspect view trees, assigns, focus, styles, rendered fragments, themes, and application logs from a separate Breeze session.

Hot code reloading

Watch and recompile changed view modules during development without restarting your terminal application.

Stacktrace viewer

Inspect crashes in a dedicated terminal view with selectable stack frames, file and line details, copyable diagnostics, and restart controls.

Testing and deployment

Deterministic tests, local terminals, or SSH sessions

Local apps

Run examples directly from Mix for counters, forms, modal flows, docs browsers, themes, and games.

SSH sessions

Serve Breeze apps over SSH so each connecting client gets an isolated terminal session backed by Termite.SSH.

Formatter support

Use the Breeze.HTMLFormatter plugin to format ~H templates alongside normal Elixir code.