termui/README.md
2018-11-28 20:50:00 -08:00

3.1 KiB

termui

Build Status Doc Status

demo cast under osx 10.10; Terminal.app; Menlo Regular 12pt.)

termui is a cross-platform, easy-to-compile, and fully-customizable terminal dashboard built on top of termbox-go. It is inspired by blessed-contrib and written purely in Go.

Installation

It's recommended to install from the master branch:

go get -u github.com/gizak/termui@master

Note that termui is currently undergoing some API changes so be prepared for things to break if you upgrade.

Usage

Hello World

package main

import ui "github.com/gizak/termui"

func main() {
	err := ui.Init()
	if err != nil {
		panic(err)
	}
	defer ui.Close()

	p := ui.NewParagraph("Hello World")
	ui.Render(p)

	for {
		e := <-ui.PollEvent()
		switch e.ID {
		case "q", "<C-c>":
			return
		}
	}
}

Widgets

Click image to see the corresponding demo codes.

barchart gauge linechart list paragraph sparklines stackedbarchart table

Examples

Examples can be found in _examples. Run with go run _examples/... or run all of them consecutively with ./scripts/run_examples.py.

Documentation

  • godoc for code documentation
  • wiki for general information

Uses

License

This library is under the MIT License