A lightweight and easy-to-use terminal UI inspired by the Material 3 and Jetpack Compose APIs built with Go
- Simple API
- Zero external dependencies
- Lightweight and fast
- Customizable table rendering
- Cross-platform
go get github.com/itssimmons/tui-composepackage main
import (
"github.com/itssimmons/tui-compose/table"
)
func main() {
t := table.Table{
Head: []string{"IMAGE", "ID", "DISK USAGE", "STATUS", "CREATED AT"},
Body: [][]string{
{"ubuntu:latest", "1a2b3c4d5e6f", "1.2 GB", "R", "2024-06-01 12:34:56"},
{"nginx:alpine", "7g8h9i0j1k2l", "512 MB", "S", "2024-05-28 08:22:10"},
},
}
t.Render()
}Example output:
IMAGE ID DISK USAGE STATUS CREATED AT
--------------------------------------------------------------------
ubuntu:latest 1a2b3c4d5e6f 1.2 GB R 2024-06-01 12:34:56
nginx:alpine 7g8h9i0j1k2l 512 MB S 2024-05-28 08:22:10
Runnable examples are available in the examples directory.
go run ./examples/basic/main.goGenerate local documentation:
go doc github.com/itssimmons/tui-compose/tableOr browse the package documentation on pkg.go.dev after publishing a tagged release.
Run all tests:
make testRun tests with coverage:
make coverageIssues and pull requests are most welcome. If you plan to introduce significant changes, please open an issue first to discuss the proposal.
This project is licensed under the MIT License.