Skip to content

Repository files navigation

Terminal UI Compose

A lightweight and easy-to-use terminal UI inspired by the Material 3 and Jetpack Compose APIs built with Go

Features

  • Simple API
  • Zero external dependencies
  • Lightweight and fast
  • Customizable table rendering
  • Cross-platform

Installation

go get github.com/itssimmons/tui-compose

Quick Start

package 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

Examples

Runnable examples are available in the examples directory.

go run ./examples/basic/main.go

Documentation

Generate local documentation:

go doc github.com/itssimmons/tui-compose/table

Or browse the package documentation on pkg.go.dev after publishing a tagged release.

Testing

Run all tests:

make test

Run tests with coverage:

make coverage

Contributing

Issues and pull requests are most welcome. If you plan to introduce significant changes, please open an issue first to discuss the proposal.

License

This project is licensed under the MIT License.

About

A lightweight and easy-to-use terminal UI inspired by the Material 3 and Jetpack Compose APIs built with Go

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages