BentoTUI Architecture Contract
BentoTUI ships with an explicit product architecture aimed at outcomes: ship a serious app shell in one day.
- Bricks and recipes are copy-and-own.
- Rooms are import-only geometry contracts.
- Bentos are runnable templates for rapid remix.
Canonical stack order
Use this order when explaining or implementing BentoTUI:
themeinterface, presets, and optional global managertheme/styleshelpers (Row,RowClip,ClipANSI)registry/brickscopy-and-own component layerregistry/recipescopy-and-own composed flowsregistry/roomsimport-only layout geometrysurfaceUV compositor- Bubble Tea frame (
tea.NewView,AltScreen,BackgroundColor)
Layer responsibilities
- Bricks: official UI building blocks copied into app code with
bento add <brick>. - Recipes: copy-and-own flow patterns copied with
bento add recipe <name>. - Rooms: stable import-only page layout contracts from
registry/rooms. - Bentos: runnable template apps under
registry/bentos/*.
Reliability guardrails
Guardrails are part of product reliability, not internal trivia:
- Rooms do not import theme, bricks, or raw bubbles.
- Bricks do not import other bricks.
- Bentos/starter/scaffold/recipes avoid raw
bubbles/*(spinner exception). - Bento
View()methods do not calltheme.CurrentTheme()directly; theme should be model-owned state.
Rendering rule
Every row drawn to surface-backed layouts should have explicit background ownership, usually via styles.Row(...), to avoid bleed and gaps.
Runtime baseline in v0.6.0
- Go module baseline:
go 1.25.2 charm.land/bubbletea/v2 v2.0.0-rc.2charm.land/bubbles/v2 v2.0.0-rc.1charm.land/lipgloss/v2 v2.0.0-beta.3github.com/charmbracelet/ultraviolet