Every directory under examples/ is a runnable program. Clone the repository and run one from its root, for example go run ./examples/dashboard.
The screens are not mock-ups: each is the first frame the example’s own size-matrix test renders at 80×24, shown with the colours its View produces. Only the 16 basic terminal colours depend on a palette, as in any terminal.
hello is the first program to read: a text field and two buttons, all of which work with the keyboard and the mouse.
go run ./examples/hello
┌──────────────────────────────────────┐│││Hello, tui││││ Your name: Ada││││[ Greet ][ Quit ]││││Press Enter, or click Greet.││││F1 help · Tab next · Ctrl+C quit│││└──────────────────────────────────────┘
stopwatch has three tabs: a stopwatch with laps, a countdown timer and a clock that shows the time in a few places.
go run ./examples/stopwatch
stopwatch▸1 Stopwatch 2 Timer 3 Clock┌─┐┌─┐┌─┐┌─┐┌─┐┌─┐││││ : ││││││││└─┘└─┘└─┘└─┘ . └─┘└─┘ Space Start l Lap r Reset Lap Time Total Note No laps yet; press l while it runs0 laps[1-3] tab[space] start/stop[l] lap[r] reset[?] help[q] quit
todo is a task list you can drive with the mouse or the keyboard.
go run ./examples/todo
┌──────────────────────────────────────────────────────────────┐│││Tasks││││ All 6 Active 5 Done 1 ││││☑Read the tutorial ✕││☐ Try the mouse: click a checkbox ✕││☐ Scroll with the wheel ✕││☐ Delete this one with its cross ✕││☐ Write a first tui program ✕││☐ Ship it ✕││││││││+ Add a task (click, or press a)││││5 leftClear done││││[click] tick[↑↓] move[a] add[?] help[q] quit│││└──────────────────────────────────────────────────────────────┘
signup is a sign-up wizard in three steps: account, plan (and billing for a paid plan), then a review you confirm.
go run ./examples/signup
┌──────────────────────────────────────────────────────────────┐│││Create your account││││1 Account2 Plan3 Review││││Account step 1 of 2││Who is this for?││ Name: Ada Lovelace││ Email: ada@example.com││ Password: ││At least 8 characters││││‹ Back Next ›││││[tab] next field[enter] continue[pgup] back…│││└──────────────────────────────────────────────────────────────┘
settings is a preferences screen: a list of categories on the left, and on the right the switches, sliders and choices of the one you picked.
go run ./examples/settings
SettingsAll changes applied General │ General Appearance │› Language ‹English › Editor │ Check for updates ━━● On Notifications │ Restore last session ━━● On│ Share usage data ○━━ Off│││││││││││││││ The language of menus and messages. Apply Reset[tab] pane[←→] change[ctrl+s] apply[ctrl+r] reset[f1] help[q] quit
colorlab is a colour workbench: set a colour with hue, saturation and lightness sliders or type its hex code, see how readable text in that colour is on white and on black, pick a shade or the complement from a derived palette, copy the hex code, and export the palette as CSS custom properties.
go run ./examples/colorlab
Colour labHue ━━━━━━━━━━━━━━━━━●━━━━━━━━━━━━ 215°Saturation━━━━━━━━━━━━━━━━━━━●━━━━━━━━━━ 65%Lightness ━━━━━━━━━━━━━━━●━━━━━━━━━━━━━━ 53%Hex #3A7BD5 #3A7BD5 Aa white 4.22 ✓ AA large Aa black 4.97 ✓ AA• [ Copy ][ Export ][ Random ]#3A7BD5[tab] control[←→] change[c] copy[e] export[f1] help
filedialog is an Open and Save As dialog built on package filepicker: browse folders, filter by kind, hide or show the dotfiles, jump to a folder by clicking it in the path bar, and type the first letters of a name to go to it.
go run ./examples/filedialog
Open fileprojectShow ▸All files Go source Text Images [ ] Show hidden (.) > docs/ │docs▸ empty/ │ Folder▸ src/ │ README.md │ Modified 2026-10-01 09:30:00 data.bin │ Mode drwxr-xr-x logo.png │ main.go │ notes.txt │ util.go ││││││││││9 entries · All files Enter Open Esc Cancel [↑↓] move[enter] open[←] up[.] hidden[f3] filter[f2] mode…
csvedit edits a CSV file as a grid: move a cursor over the cells, change one, add and remove rows and columns, sort by a column, undo, and save.
go run ./examples/csvedit
csveditsample12 rows × 4 cols[+Row][+Col][−Row][−Col][Sort][Undo][Redo][Save]city country population area_km2 1 Tokyo Japan 37400000 2194 2 Delhi India 31000000 1484 3 Shanghai China 27100000 6341 4 São Paulo Brazil 22000000 1521 5 Mexico City Mexico 21800000 1485 6 Cairo Egypt 20900000 3085 7 Mumbai India 20400000 603 8 Beijing China 20000000 16411 9 Dhaka Bangladesh 21000000 30610 Osaka Japan 19200000 22511 New York USA 18800000 78312 Lagos Nigeria 15400000 1171A1city"Tokyo"[enter] edit[o] row[s] sort[ctrl+z] undo[ctrl+s] save[f1] help…
jsonx explores a JSON document as a tree: open and close branches, search keys and values, see the path of the selected value and a preview of it, and copy the path or the value.
pkgs is a package manager's browser: a list you filter as you type, a detail pane for the one selected, a pager, and an install queue that installs, updates and removes with a progress bar.
launcher is a command palette for a project: type to narrow the list of commands (a fuzzy match on name and description, the ones you ran last first), press Enter to run one, and read its output below as it arrives.
go run ./examples/launcher
launchersample project, scripted›Type a command name…› build Compile the project test Run the tests with the race detector test-flaky Run the tests that sometimes fail lint Check the code with the linters fmt Format every source file bench Run the benchmarksOutput appears here[enter] run[ctrl+x] cancel[ctrl+r] rerun[pgup/pgdn] scroll[f1] help…
sqlbrowse is a read-only SQL browser over a small made-up shop database held in memory: pick a table, write a SELECT, read the result in a grid, export it as CSV, and recall earlier queries.
go run ./examples/sqlbrowse
sqlbrowse read-only Run History Export Tables│SQL ▸ SELECT * FROM customers LIMIT 20 customers 30 │✓ 20 rows × 6 columns in 0s orders 80 │ id name city country signu products 15 │ 1 1 Ada Lovelace Mumbai India 2024 order_items 156 │ 2 2 Alan Turing Oslo Norway 2025│ 3 3 Grace Hopper Cairo Egypt 2023 customers│ 4 4 Edsger Dijkstra Mumbai India 2023 id int│ 5 5 Barbara Liskov Mumbai India 2024 name text│ 6 6 Donald Knuth Cairo Egypt 2025 city text│ 7 7 Margaret Hamilton Sydney Australia 2025 country text│ 8 8 Dennis Ritchie Berlin Germany 2024 signup date│ 9 9 Ken Thompson Sydney Australia 2024 vip bool│10 10 Linus Torvalds Mumbai India 2023│11 11 Radia Perlman Sydney Australia 2024│12 12 Tim Berners-Lee Tokyo Japan 2023│13 13 Hedy Lamarr Tokyo Japan 2023│14 14 John von Neumann Sydney Australia 2023│15 15 Katherine Johnson Toronto Canada 2025│16 16 Claude Shannon Tokyo Japan 2024│17 17 Annie Easley Cairo Egypt 2025│18 18 Vint Cerf Berlin Germany 2025query · 4 tables · 1 queries in history[enter] run[tab] pane[ctrl+r] history[ctrl+t] tables[ctrl+e] export…
charts explores a few made-up data sets as line, scatter, bar and histogram charts: toggle series on and off, zoom into the x axis, drag to pan, and hover to read the values at one place.
go run ./examples/charts
charts Temperature (°C) Temperature Latency Waves Growth Line Scatter Bars Histogram 30┤⣀⣀⣀⣀⡠⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⣀⣀│⣀⠤⠔⠒⠊⠉⠉⠉⠉⠒⠒⠤⠤⣀⡀│⣀⠤⠒⠉⠈⠉⠑⠢⢄⡀│⣀⠤⠒⠉⠈⠒⢄⡀ 20┤⣀⡠⠔⠊⠉⢀⣀⡠⠤⠔⠒⠒⠒⠒⠒⠒⠒⠒⠤⣀⠈⠑⠤⣀│⣀⠤⠔⠒⠉⢀⡠⠤⠒⠊⠉⣁⡠⠤⠔⠒⠉⠉⠑⠒⠒⠒⠤⠤⣀⠉⠒⠤⣀⠉⠒⠤⣀│⠒⠒⠒⠊⠉⠉⠉⠉⣀⠤⠒⠉⠁⣀⡠⠔⠊⠉⠉⠢⢄⠑⠢⢄⡀⠉│⣀⠔⠊⣀⠤⠒⠉⠉⠒⢄⡀⠈⠒⠤⣀ 10┤⣀⠤⠒⠉⢀⠔⠊⠈⠑⠢⣀⠑⠢⢄⡀│⢀⡠⠔⠊⠉⢀⠤⠊⠁⠉⠒⢄⡀⠈⠑⠢⢄│⢀⡠⠔⠊⠁⡠⠔⠊⠁⠈⠑⠤⡀⠉⠒⠤⣀ 0┤⣀⣀⣀⡠⠤⠤⠤⠔⠊⠁⢀⠤⠒⠉⠈⠑⠢⢄⣀⡀⠉⠒⠤│⢀⡠⠔⠊⠁⠈⠉⠒⠒⠤│⠤⠤⠤⠤⠤⠤⠤⠔⠊⠁│-10┤└───────────────────────────────────────────────────────────────────────────Jan Apr Jun Sep Dec● 1 Berlin ● 2 Cairo ● 3 Osloall 12 points · hover for values, wheel to zoom, drag to pan[←→] cursor[+/-] zoom[tab] data[t] type[1-3] series[f1] help[q] quit
pager reads a file or standard input the way less does: page and line scrolling, search with highlighted matches, a percent bar you can click, optional line numbers and wrapping, and a follow mode for files that grow.
go run ./examples/pager
PAGER SAMPLE============This text stands in for a file. Press / to search, w to wrap, # for linenumbers, F to follow, ? for help.Section 1--------- 1.1 The quick brown fox number 11 jumps over the lazy dog, then reads a long line that is wide enough to need wrapping or sideways scrolling in a narrow window. 1.2 The quick brown fox number 12 jumps over the lazy dog, then reads a long line that is wide enough to need wrapping or sideways scrolling in a narrow window. 1.3 The quick brown fox number 13 jumps over the lazy dog, then reads a long line that is wide enough to need wrapping or sideways scrolling in a narrow window. 1.4 The quick brown fox number 14 jumps over the lazy dog, then reads a long line that is wide enough to need wrapping or sideways scrolling in a narrow window. 1.5 The quick brown fox number 15 jumps over the lazy dog, then reads a long line that is wide enough to need wrapping or sideways scrolling in a narrow winsample lines 1–22 of 139 ──────────── 0%[space] page[/] search[n] next[w] wrap[#] numbers[F] follow…
mdstudio is a Markdown editor with a live preview: the text on the left, the rendered document on the right, and a list of the headings (the outline) beside them.
go run ./examples/mdstudio
mdstudiountitled.md[H][B][I][`][Link][List][Save] 1 #Releasenotes│Releasenotes 2 │ 3 Welcome to **mdstudio**. Edit on the│Welcometomdstudio.Editontheleft left and the preview on the right f│andthepreviewontherightfollowsollows │you.Pressctrl+btomaketheselection 4 you. Press `ctrl+b` to make the sele│bold.ction **bold**. │ 5 │Whatchanged 6 ##Whatchanged│ 7 │• Anewpagerexamplereadsfileslike 8 - A new `pager` example reads files │lesslike less │• Thetableismuchfaster 9 - The table is *much* faster │• Mousesupporteverywhere10 - Mouse support everywhere │11 │Numbers12 ###Numbers│13 │Area│Before│After14 | Area | Before | After | │────────────────────────15 |-----------|--------|-------| │Frame│120µs│64µs16 | Frame | 120 µs | 64 µs | │Startup│11ms│4ms17 | Startup | 11 ms | 4 ms | │ editor Ln 1, Col 1 130 words 5 headings [ctrl+w] pane[ctrl+s] save[ctrl+b] bold[f1] help[ctrl+q] quit
docsreader reads a folder of Markdown files as a small documentation site in the terminal: a sidebar of the pages with the headings of the open one, links you can follow from page to page, back and forward through where you have been, and search across every page.
go run ./examples/docsreader
docsreader Parcel docs[‹][›] Parcel docs │Parceldocs What is in here │ FAQ │Parcelmovessmallfilesbetweenmachines.Start Quick start │withthequickstart(quickstart.md),readabout Testing │thetablewidget(widgets/table.md),orseethe Forms │FAQ(faq.md). Table ││Whatisinhere││• Quickstart(quickstart.md):sendyourfirst│file│• Table(widgets/table.md)andForms│(widgets/forms.md):thetwoscreensyouwill│usemost│• Testing(testing.md):checkatransferwithout│anetwork│• FAQ(faq.md):thequestionspeopleaskfirst││Theprojectlivesatexample.com/parcel│(https://example.com/parcel).│6 pages · README.md[tab] link[/] search[s] sidebar[bksp] back[?] help[q] quit
hexedit edits a file as bytes: the offset, the bytes in hex and the same bytes as text, side by side, with a cursor, a selection, search, go to offset, insert and delete, undo, and a small inspector that reads the bytes under the cursor as numbers.
kanban is a three-column task board: To do, Doing and Done.
go run ./examples/kanban
kanban 2 of 8 done To do (4) Doing (2) Done (2)▌Write the release notes Review the form groups p Cut rc.1 Fix the flaky resize tes Record the demo for the Add the colour toolkit Reply to the issue about Plan the v1 freeze + add + add + add8 cards · drag a card to another column[←→↑↓] select[<>] move[a] add[e] rename[d] delete[?] help[q] quit
paint draws on a canvas of coloured pixels: pen, eraser, line, rectangle and flood fill, eight colours, three brush sizes, undo and redo, and save as text.
go run ./examples/paint
paint▸Pen Eraser Line Rect Fill brush 1[1██] 2██ 3██ 4██ 5██ 6██ 7██ 8██┌──────────────────────────────────────────────────────────────────────────────┐││││││││││││││││││││││││││││││││││││└──────────────────────────────────────────────────────────────────────────────┘39x18 pixels · saved[p e l r f] tool[1-8] colour[space] draw[u] undo[s] save[?] help…
gallery is a tour of the components that sit around the main screen: menus and the overlays that open over it (dialog, drawer, popover, toast), loading states (loading bar, skeleton, scroll bar, virtual list), fields (email, masked, autocomplete, colour picker) and a step wizard.
go run ./examples/gallery
Gallery page 1 of 4 Menus Loading Fields Wizard────────────────────────────────────────────────────────────────────────────────Menu > OpenOverlays Recent d dialog w drawer Quit p popover t toast nothing chosen yet F1-F4 page ? keys Ctrl+C quit
workspace is an editor-style window split into three panes with tabs: an explorer on the left, an editor at the top right and a panel at the bottom right.
go run ./examples/workspace
workspace▸Files Outline 1/18 │▸main.go notes.md todo.txt 1/26▾ workspace │ 1 package main▾ cmd │ 2 main.go │ 3 import (▾ internal │ 4 "flag"▸ cache │ 5 "fmt"▸ config │ 6 "os"▸ server │ 7 ) doc.go │ 8▾ testdata │ 9 // run starts the server and waits for it to stop golden.txt │ 10 func run(addr string) error { sample.json │ 11 s := newServer(addr) README.md │─────────────────────────────────────────────────────── go.mod │▸Output Problems Log 1/31 go.sum │build step 1 of 30: ok Makefile │build step 2 of 30: ok LICENSE │build step 3 of 30: ok CHANGELOG.md │build step 4 of 30: ok .gitignore │build step 5 of 30: ok│build step 6 of 30: ok│build step 7 of 30: okEditor focused · main.go[tab] pane[.,] tab[[ ]] resize[c] collapse[z] zoom[?] help[q] quit
desktop is a small windowing system in the terminal: four windows (a clock, a counter, a notepad and an event log) that you drag by the title bar, resize by an edge, stack, hide to a task bar, close and bring back, and a modal dialog that blocks the rest until you answer.
routerapp is a small multi-screen app: a sidebar of sections, a breadcrumb trail, a back button, and a stack of screens that you push by opening an item and pop by going back.
chat is a small chat client with channels, message history, an input line, a typing indicator and replies that stream in.
go run ./examples/chat
chat? help #general │mira09:12 #design 2 │ Morning! The release branch is cut and the checks are green. #random 1 │jon09:15│ Great. I will write the changelog after lunch.│mira09:16│ Please keep it short: one line per change, newest first.│you09:20│ On it. Do we mention the scroll region fix?│││││││││││││›Write a message and press Enter[Enter] send[ctrl+n] channel[PgUp/PgDn] scroll[?] help[ctrl+q] quit
codeagent is the shell of a coding agent, driven by a script so it runs offline: a transcript of what you asked and what the agent said, tool calls shown as cards, and a prompt at the bottom.
go run ./examples/codeagent
codeagent ~/tui · layout/· Ask for something: "fix the failing test", "delete the build directory" or· "explain the layout package". /help lists the commands.ready · 0 tokens · scripted-1❯Ask the agent… (/help)[enter] send[y/n] approve/deny[↑↓] history[pgup] scroll[esc] stop…
themestudio is a workshop for themes: pick one of the twenty built-in themes, change any of its fifteen colours with red, green and blue sliders or a hex code, and watch a sample screen redraw at once.
go run ./examples/themestudio
themestudio◂tokyo-night▸20/20▸██ Primary #7aa2f7 │Primary#7aa2f7████ 6.79:1 on background ✓ A██ Secondary #bb9af7 │▸R ███████████████░░░░░░░░░░░░░░░░░ 122██ Success #9ece6a │G ████████████████████░░░░░░░░░░░░ 162██ Warning #e0af68 │B ██████████████████████████████░░ 247██ Error #f7768e │[x reset][0 all][b border: base][g glyphs: bas██ Info #7dcfff │ Preview · tokyo-night██ Muted #565f89 │ Body text in the text colour, and muted for the ██ Text #c0caf5 │ Primary Secondary ▌ focused██ Text inverse #1a1b26 │✓ done⚠ careful✗ failedℹ note██ Border #292e42 │██████████░░░░░░░░ 60%██ Focus #7aa2f7 │▾ tree • muted item selected row ██ Selection #283b4d │Tab one Tab two Tab three██ Background #1a1b26 │┌──────────────────────────┐██ Surface #242632 ││ A card on the surface │██ Overlay #2e303f │└──────────────────────────┘│ Overlay: menu or dialog │ Below 4.5:1: Muted 2.8││││No changes to tokyo-night yet; saving writes the base alone[↑↓] colour[tab] slider[←→] change[[ ]] base[s] save[?] help[q] quit
inputlab shows every key, mouse, paste, focus and resize event as it arrives, decoded the way the library hands it to Update, plus what the terminal said it can do.
go run ./examples/inputlab
inputlab● keys 0● mouse 0● paste 0● other 1● join motion[pause][cl 1 resize 80x241 events · last gap 0s[ctrl+c] quit[ctrl+p] pause[ctrl+l] clear[f2-f6] filters[f1] help
probe shows what your terminal supports, using the library's opt-in capability options: colour depth (with NO_COLOR, COLORTERM and TERM honoured), focus in/out reporting, and OSC 11 background detection.
go run ./examples/probe
tui probe: what does your terminal do? TERM="xterm-256color" COLORTERM="truecolor" NO_COLOR="" Colour profile: truecolor (detected; drives the strip below) Focus reports: in=0 out=0 last=unknown (click another window, then back) Background: waiting theme=- (asked once at start, 700ms timeout) Last key: - Size (resize): 80x24q or ctrl+c to quit; a summary line stays in your scrollback probe: profile=truecolor focus_in=0 focus_out=0 background=waiting theme=-focus timeline: focus reporting enabled: (not yet)
buildstatus runs a made-up build pipeline in the terminal's own scrollback (no alternate screen): eight steps with dependencies, several running at once, each with a spinner, a progress bar and its latest line of output.
go run ./examples/buildstatus
Building 0.0s · 0/8 done · 1 running, up to 3⠋ fetch modules ░░░░░░░░░░ 0%· compile ansi waits for fetch modules· compile layout waits for fetch modules· compile widgets waits for fetch modules· link tui waits for compile ansi, compile layout, compile widgets· vet waits for compile ansi, compile layout, compile widgets· test waits for link tui· package waits for link tui, vet, testctrl+c cancel · +/- jobs · v output · ? help
ssh: ssh serves a chat lobby over SSH, so anyone who connects gets their own copy of the program in their own terminal and everyone sees the same room, the way Charm’s wish does for Bubble Tea:
survey: survey is a short questionnaire at the command line, with no Model of its own: every question is one call of package prompt, and nothing takes over the screen.
tutorial2: tutorial2 is the program built in docs/tutorial-2.md: the task list of the first tutorial with a list that narrows as you type and a column of counts, using picker’s Filter.