Update readme

This commit is contained in:
Caleb Bassi 2019-01-28 01:13:33 -08:00
parent 2298d75b8d
commit a01016fd0d

View File

@ -4,13 +4,46 @@
termui 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.
The core components of termui include:
## Features
- built in widget implementations for common use cases
- utilities to create custom widgets
- a Grid for relative widget positioning
- an event system for keyboard, mouse and resizing events
- colors and styling
- Built in widget implementations for common use cases
- Utilities to create custom widgets
- A grid layout for relative widget positioning
- Mouse support
- Event handling for keyboard, mouse and resizing events
- Colors and styling
## Hello World
```go
package main
import (
"log"
ui "github.com/gizak/termui"
"github.com/gizak/termui/widgets"
)
func main() {
if err := ui.Init(); err != nil {
log.Fatalf("failed to initialize termui: %v", err)
}
defer ui.Close()
p := widgets.NewParagraph()
p.Text = "Hello World!"
p.SetRect(0, 0, 25, 5)
ui.Render(p)
for e := range ui.PollEvents() {
if e.Type == ui.KeyboardEvent {
break
}
}
}
```
## Installation