A Go framework for building interactive terminal UIs with React-style components and hooks.
Inspired by React and Flutter, Retui brings a component-based, reactive approach to building terminal applications.
Contributing
Contributions are welcome. Please follow these guidelines to keep the codebase consistent.
Getting Started
git clone https://github.com/subhasundardass/retui
cd retui
go mod download
go test ./...
Workflow
Open an issue first for non-trivial changes to align on the approach before writing code.
Branch off main:git checkout -b feat/my-feature
Keep commits focused — one logical change per commit with a clear message.
Add tests for new layout or rendering behaviour in *_test.go files.
Run tests and vet before opening a PR:
go test ./...
go vet ./...
Open a pull request against main with a description of what changed and why.
Code Style
Follow standard Go conventions (gofmt, golint)
Keep component functions pure where possible; side effects belong in UseEffect
New built-in components go in retui/components/ — simple/display in components.go, interactive in interactive.go, compound in complex.go
Avoid adding dependencies; the stdlib + the two existing deps cover most needs
Adding a Component
Write the component function in the appropriate file under retui/components/.
Use plain typed parameters where possible; reserve props.Values for genuinely dynamic data.
Add a runnable demo under examples/<your-feature>/main.go.
Document signature, keyboard contract, and a snippet in DOCS.md under the relevant section.