Bubble Tea is a powerful TUI framework for Go with a steep learning curve. Key tips include keeping the event loop fast by offloading expensive operations, dumping messages to a file for debugging, implementing live reload for code changes, judicious use of method receivers, understanding message ordering, building a tree of models for complex apps, handling layout arithmetic carefully, recovering the terminal from panics, using teatest for end-to-end testing, and leveraging Charm's VHS tool for recording demos and screenshots.

19m read timeFrom leg100.github.io
Post cover image
Table of contents
0. Intro1. Keep the event loop fast2. Dump messages to a file3. Live reload code changes4. Use receiver methods on your model judiciously5. Messages are not necessarily received in the order they are sent6. Build a tree of models7. Layout arithmetic is error-prone8. Recovering your terminal9. Use teatest for end-to-end tests10. Record demos and screenshots on VHS11. And more…

Sort: