Cookbook
Short "how do I…" recipes. Each one is one or two screens of explanation plus a self-contained snippet, grounded in actual TermFlow APIs and (where possible) a sample app you can run.
Recipes
- Show a confirm dialog and act on the answer
—
Dialogs.confirm, model-owned dialog state, key routing while modal. - Stream output into a scrollback view —
widgets.LogView, append-and-tail buffering, auto-tail vs. paused scroll. - Build a rolling console / agent UI — Claude-Code-style transcript with a pinned bottom prompt, auto-tail, pause-on-scroll-up, mouse-wheel scrollback, bounded history.
- Pause and resume a
Sub.Everytimer — cancel + recreate,Sub.NoSubplaceholder, interval changes. - Open a file picker and load the result —
Dialogs.fileDialogintegration pattern, directory navigation, Esc-to-cancel. - Two-pane layout with a draggable splitter
—
SplitPane.handleMouse,DragState, keyboard-equivalent shortcuts. - Capture mouse clicks on a custom widget
—
Layout.Zone+Layout.resolveTracked+HitTest[Id]. - Wide-character (CJK / emoji) input handling
—
WCWidth,Grapheme,RenderCell.width = 2. - Clean shutdown on
Ctrl-Cand on resize — what the runtime does for you, where you still have to wireCmd.Exit. - Flag a session as needing attention —
Cmd.RequestAttention,Cmd.Notify, terminal detection (iTerm2 / kitty / VTE), tmux caveats. - Full-screen layouts that reflow on resize —
Layout.toBudgetedRootNodevs.toRootNode,Fillsemantics, header/fill/footer pattern.
Want more?
Recipe gaps are tracked as GitHub issues. If you've got a "how do I do X" that isn't covered, please open an issue — most recipes start as a question that came up twice.