https://github.com/navidys/tvxwidgets
tvxwidgets provides extra widgets for tview
https://github.com/navidys/tvxwidgets
golang terminal-interface user-interface
Last synced: 2 months ago
JSON representation
tvxwidgets provides extra widgets for tview
- Host: GitHub
- URL: https://github.com/navidys/tvxwidgets
- Owner: navidys
- License: mit
- Created: 2021-12-19T04:06:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-26T02:09:19.000Z (3 months ago)
- Last Synced: 2025-04-26T03:31:19.596Z (3 months ago)
- Topics: golang, terminal-interface, user-interface
- Language: Go
- Homepage:
- Size: 1.18 MB
- Stars: 163
- Watchers: 3
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# tvxwidgets
[](https://pkg.go.dev/github.com/navidys/tvxwidgets)

[](https://codecov.io/gh/navidys/tvxwidgets)
[](https://goreportcard.com/report/github.com/navidys/tvxwidgets)tvxwidgets provides extra widgets for [tview](https://github.com/rivo/tview).

## Widgets
* [bar chart](./demos/barchart/)
* [activity mode gauge](./demos/gauge_am/)
* [percentage mode gauge](./demos/gauge_pm/)
* [utilisation mode gauge](./demos/gauge_um/)
* [message dialog (info and error)](./demos/dialog/)
* [spinner](./demos/spinner/)
* [plot (linechart, scatter)](./demos/plot/)
* [sparkline](./demos/sparkline/)## Example
```go
package mainimport (
"time""github.com/gdamore/tcell/v2"
"github.com/navidys/tvxwidgets"
"github.com/rivo/tview"
)func main() {
app := tview.NewApplication()
gauge := tvxwidgets.NewActivityModeGauge()
gauge.SetTitle("activity mode gauge")
gauge.SetPgBgColor(tcell.ColorOrange)
gauge.SetRect(10, 4, 50, 3)
gauge.SetBorder(true)update := func() {
tick := time.NewTicker(500 * time.Millisecond)
for {
select {
case <-tick.C:
gauge.Pulse()
app.Draw()
}
}
}
go update()if err := app.SetRoot(gauge, false).EnableMouse(true).Run(); err != nil {
panic(err)
}
}```