Skip to content

navidys/tvxwidgets

Folders and files

NameName
Last commit message
Last commit date
Mar 15, 2025
Oct 13, 2024
Jul 2, 2022
Dec 19, 2023
Mar 15, 2025
Jul 2, 2022
Jun 8, 2024
Dec 15, 2023
Dec 19, 2021
Jul 2, 2022
Mar 15, 2025
Dec 19, 2023
Oct 26, 2024
Dec 20, 2023
Dec 17, 2022
Jun 21, 2024
Dec 20, 2023
Dec 19, 2023
Oct 26, 2024
Dec 20, 2023
Oct 26, 2024
Dec 20, 2023
Oct 26, 2024
Dec 20, 2023
Mar 15, 2025
Mar 15, 2025
Oct 26, 2024
Dec 20, 2023
Oct 26, 2024
Dec 20, 2023
Oct 23, 2022
Dec 20, 2023
Dec 19, 2023
Oct 26, 2024
Dec 19, 2023

Repository files navigation

tvxwidgets

PkgGoDev Go codecov Go Report

tvxwidgets provides extra widgets for tview.

Screenshot

Widgets

Example

package main

import (
	"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)
	}
}