• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

_assets/H03-May-2022-

_examples/H07-Mar-2019-1,105863

_scripts/H07-Mar-2019-5537

_test/H07-Mar-2019-3623

widgets/H07-Mar-2019-1,3181,042

.gitignoreH A D07-Mar-201938 54

CHANGELOG.mdH A D07-Mar-20192.8 KiB12279

LICENSEH A D07-Mar-20191.1 KiB2317

MakefileH A D07-Mar-201999 65

README.mdH A D07-Mar-20192.5 KiB9468

alignment.goH A D07-Mar-2019100 107

backend.goH A D07-Mar-2019770 3623

block.goH A D07-Mar-20192.7 KiB10677

buffer.goH A D07-Mar-20191.5 KiB7756

canvas.goH A D07-Mar-2019757 4436

doc.goH A D07-Mar-2019280 91

events.goH A D07-Mar-20194.7 KiB212156

go.modH A D07-Mar-2019349 108

go.sumH A D07-Mar-20191.1 KiB1110

grid.goH A D07-Mar-20193.2 KiB161129

render.goH A D07-Mar-2019768 3930

style.goH A D07-Mar-20191.3 KiB6645

style_parser.goH A D07-Mar-20193.8 KiB157129

symbols.goH A D07-Mar-20191.1 KiB5442

symbols_other.goH A D07-Mar-2019549 2917

symbols_windows.goH A D07-Mar-2019522 2917

theme.goH A D07-Mar-20192.5 KiB155120

utils.goH A D07-Mar-20194.5 KiB231190

README.md

1# termui
2
3[<img src="./_assets/demo.gif" alt="demo cast under osx 10.10; Terminal.app; Menlo Regular 12pt.)" width="100%">](./_examples/demo.go)
4
5termui is a cross-platform and fully-customizable terminal dashboard and widget library built on top of [termbox-go](https://github.com/nsf/termbox-go). It is inspired by [blessed-contrib](https://github.com/yaronn/blessed-contrib) and [tui-rs](https://github.com/fdehau/tui-rs) and written purely in Go.
6
7## Features
8
9- Several premade widgets for common use cases
10- Easily create custom widgets
11- Position widgets either in a relative grid or with absolute coordinates
12- Keyboard, mouse, and terminal resizing events
13- Colors and styling
14
15## Installation
16
17```bash
18go get github.com/gizak/termui/v3
19```
20
21## Hello World
22
23```go
24package main
25
26import (
27	"log"
28
29	ui "github.com/gizak/termui/v3"
30	"github.com/gizak/termui/v3/widgets"
31)
32
33func main() {
34	if err := ui.Init(); err != nil {
35		log.Fatalf("failed to initialize termui: %v", err)
36	}
37	defer ui.Close()
38
39	p := widgets.NewParagraph()
40	p.Text = "Hello World!"
41	p.SetRect(0, 0, 25, 5)
42
43	ui.Render(p)
44
45	for e := range ui.PollEvents() {
46		if e.Type == ui.KeyboardEvent {
47			break
48		}
49	}
50}
51```
52
53## Widgets
54
55- [BarChart](./_examples/barchart.go)
56- [Canvas](./_examples/canvas.go) (for drawing braille dots)
57- [Gauge](./_examples/gauge.go)
58- [Image](./_examples/image.go)
59- [List](./_examples/list.go)
60- [Paragraph](./_examples/paragraph.go)
61- [PieChart](./_examples/piechart.go)
62- [Plot](./_examples/plot.go) (for scatterplots and linecharts)
63- [Sparkline](./_examples/sparkline.go)
64- [StackedBarChart](./_examples/stacked_barchart.go)
65- [Table](./_examples/table.go)
66- [Tabs](./_examples/tabs.go)
67
68Run an example with `go run _examples/{example}.go` or run each example consecutively with `make run-examples`.
69
70## Documentation
71
72- [wiki](https://github.com/gizak/termui/wiki)
73
74## Uses
75
76- [dockdash](https://github.com/byrnedo/dockdash)
77- [expvarmon](https://github.com/divan/expvarmon)
78- [go-ethereum/monitorcmd](https://github.com/ethereum/go-ethereum/blob/master/cmd/geth/monitorcmd.go)
79- [go-jira-ui](https://github.com/mikepea/go-jira-ui)
80- [gotop](https://github.com/cjbassi/gotop)
81- [termeter](https://github.com/atsaki/termeter)
82
83## Related Works
84
85- [blessed-contrib](https://github.com/yaronn/blessed-contrib)
86- [gocui](https://github.com/jroimartin/gocui)
87- [termdash](https://github.com/mum4k/termdash)
88- [tui-rs](https://github.com/fdehau/tui-rs)
89- [tview](https://github.com/rivo/tview)
90
91## License
92
93[MIT](http://opensource.org/licenses/MIT)
94