Guides¶
The eight pages below build on each other in the order given. The first three are the whole model; everything after them is a part of the library you can reach for when you need it.
The model¶
Views explains what a View is: a rectangular grid of cells, and the combinators that build one from smaller ones. Start here. Nothing else makes sense until hcat, vcat and zcat do.
State and effects covers ui.state, ui.reducer, ui.every, ui.task and ui.spawn. Hook slots are matched by call order, which is the one rule in the library that will bite you if you skip it.
Input deals with keys, mouse, focus and consumption. Two rules decide who gets an event: focus, and whether a handler returned True.
The parts¶
Widgets is the catalogue. Every signature on this page is compared against the code on every commit, so it cannot drift.
Dialogs and modals describes ui.open_modal, which an app awaits like any coroutine, and the dialog helpers built on it.
Using Rich renderables shows how to draw a Rich table, syntax block or progress bar into a view, for when you already have one.
Painting a region yourself introduces View.passthrough, for images, another program's output, or anything the cell grid cannot express.
Testing renders an app headlessly, feeds it events, and checks the screen it drew. This is how the library tests itself, so it is a well-worn path.
Where to go next¶
The architecture page is the same material from underneath: what happens between your function returning a view and the terminal changing. What is stable says which of the names on these pages are safe to build on today.