Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Coursera

TUI from Zero

Pragmatic AI Labs via Coursera

Overview

AI, Data Science & Cloud Certificates from Google, IBM & Meta — 50% Off
One plan covers every Professional Certificate on Coursera. 50% off Coursera Plus Annual for 10 days only — price increases June 17.
Unlock All Certificates
TUI from Zero teaches you to build a pure-Rust terminal-UI framework from first principles to a working ptop-mini process monitor. Across five modules, you'll learn the wire format of a terminal — cells, ANSI escape sequences, Unicode block elements, and Braille code points — and how CellBuffer and DiffRenderer turn those primitives into a zero-allocation steady state. You'll master the Elm-style init/update/view shape, composite layout with Container/Row/Column, the .prs declarative scene format, and probar snapshot testing so every render byte is deterministic in CI. The capstone is ptop-mini, a Rust process monitor whose production binary swaps a Snapshot fixture for a live /proc reader without changing one line of the view function. Every widget is gated by a YAML contract and a probar snapshot test, so the framework you build is provable, not merely working. You should be comfortable with intermediate Rust — ownership and borrowing, traits and generics, Result and the ? operator. No prior terminal-UI experience is required.

Syllabus

  • Render — CellBuffer and the Widget Trait
    • Build the rendering core of a Rust TUI from first principles. Learn how a terminal is a 2D grid of cells, how double-width Unicode is kept safe, why ANSI escape sequences are the wire format, and how CellBuffer and the Widget trait give you one paint(rect) method that composes everything else.
  • React — Elm-style Event Loop
    • Wire user input to state through the Elm Architecture's three pure functions: init, update, and view. Model the counter app as a struct, define Msg as an exhaustive enum, and run crossterm's poll/read loop with raw mode. Map every KeyEvent through a total dispatch function so update never sees noise, and exit cleanly on Esc, Ctrl-C, or q.
  • Compose — Widgets in Anger
    • Compose widgets that do real work — Sparklines from eight Unicode block glyphs, BrailleGraphs at 4x resolution, a CpuGrid that wraps one cell per core, a ProcessTable that scrolls, and a MemoryBar that fills. Each widget is one paint(rect) call; together they form a live system-monitor TUI.
  • Declare and Verify — YAML Scenes and Probar Tests
    • Move from imperative paint calls to declarative scenes. Write .prs files that describe layout, then watch a 200-line recursive-descent compiler reconcile them against your widgets. Lock the look with probar snapshot tests — stringified CellBuffers, inline or file-backed goldens, byte-identical between runs, all running in CI without a TTY.
  • Untitled Module
    • Bring everything together: a deterministic Snapshot fixture feeds a single pure view that composes CpuGrid, Sparkline, MemoryBar, and ProcessTable into one ptop-mini dashboard, then swap the fixture for a /proc reader to run the same view live.

Taught by

Noah Gift

Reviews

Start your review of TUI from Zero

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.