How rivo/tview works
tview is a Go library for building interactive terminal user interfaces. A caller constructs an application, assigns a root primitive, and runs it; the application manages terminal interaction and renders the primitive hierarchy. The library provides layout containers, interactive controls, and navigable or visual content widgets. The README documents these major capabilities, while sampled source confirms a few internal compositions, including inputs built on text areas and dropdowns using lists. Many widget-to-widget relationships are not evidenced by the excerpts, so those links are omitted.
Main entry points: application.go Application · form.go Input forms · dropdown.go Dropdown selection · inputfield.go Text input
Components 23
Application runtime
- Application
application.go
Layout containers
- Box primitive
box.go - Flex layout
flex.go - Grid layout
grid.go - Frame layout
frame.go - Pages layout
pages.go
Interactive controls
- Input forms
form.go - Text input
inputfield.go - Text area
textarea.go - Dropdown selection
dropdown.go - Checkbox
checkbox.go - Button
button.go - Modal window
modal.go
Content widgets
- Navigable text
textview.go - Table view
table.go - Tree view
treeview.go - Selectable list
list.go - Image display
image.go - Semigraphics
semigraphics.go - ANSI support
ansi.go - Text utilities
strings.go
Other components
- TUI caller
- Terminal screen
Connections 9
- TUI caller → Application: creates and runs
README.md - TUI caller → Box primitive: sets root
README.md - Application → Terminal screen: uses screen
application.go - Application → Box primitive: renders root
- Text input → Text area: delegates editing
inputfield.go - Dropdown selection → Selectable list: draws options
dropdown.go - Dropdown selection → Text input: uses prefix input
dropdown.go - Input forms → Button: creates buttons
form.go - Input forms → Text area: supports text areas