Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
_assets/ | H | 03-May-2022 | - | |||
_examples/ | H | 07-Mar-2019 | - | 1,105 | 863 | |
_scripts/ | H | 07-Mar-2019 | - | 55 | 37 | |
_test/ | H | 07-Mar-2019 | - | 36 | 23 | |
widgets/ | H | 07-Mar-2019 | - | 1,318 | 1,042 | |
.gitignore | H A D | 07-Mar-2019 | 38 | 5 | 4 | |
CHANGELOG.md | H A D | 07-Mar-2019 | 2.8 KiB | 122 | 79 | |
LICENSE | H A D | 07-Mar-2019 | 1.1 KiB | 23 | 17 | |
Makefile | H A D | 07-Mar-2019 | 99 | 6 | 5 | |
README.md | H A D | 07-Mar-2019 | 2.5 KiB | 94 | 68 | |
alignment.go | H A D | 07-Mar-2019 | 100 | 10 | 7 | |
backend.go | H A D | 07-Mar-2019 | 770 | 36 | 23 | |
block.go | H A D | 07-Mar-2019 | 2.7 KiB | 106 | 77 | |
buffer.go | H A D | 07-Mar-2019 | 1.5 KiB | 77 | 56 | |
canvas.go | H A D | 07-Mar-2019 | 757 | 44 | 36 | |
doc.go | H A D | 07-Mar-2019 | 280 | 9 | 1 | |
events.go | H A D | 07-Mar-2019 | 4.7 KiB | 212 | 156 | |
go.mod | H A D | 07-Mar-2019 | 349 | 10 | 8 | |
go.sum | H A D | 07-Mar-2019 | 1.1 KiB | 11 | 10 | |
grid.go | H A D | 07-Mar-2019 | 3.2 KiB | 161 | 129 | |
render.go | H A D | 07-Mar-2019 | 768 | 39 | 30 | |
style.go | H A D | 07-Mar-2019 | 1.3 KiB | 66 | 45 | |
style_parser.go | H A D | 07-Mar-2019 | 3.8 KiB | 157 | 129 | |
symbols.go | H A D | 07-Mar-2019 | 1.1 KiB | 54 | 42 | |
symbols_other.go | H A D | 07-Mar-2019 | 549 | 29 | 17 | |
symbols_windows.go | H A D | 07-Mar-2019 | 522 | 29 | 17 | |
theme.go | H A D | 07-Mar-2019 | 2.5 KiB | 155 | 120 | |
utils.go | H A D | 07-Mar-2019 | 4.5 KiB | 231 | 190 |
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