tview README

The project's README from github.com/rivo/tview. As one markdown file: README.md.

Rich Interactive Widgets for Terminal UIs

PkgGoDev Go Report

This Go package provides commonly used components for terminal based user interfaces.

Screenshot

Among these components are:

They come with lots of customization options and can be easily extended to fit your needs.

Usage

To add this package to your project:

go get github.com/rivo/tview@master

Hello World

This basic example creates a box titled "Hello, World!" and displays it in your terminal:

package main

import (
	"github.com/rivo/tview"
)

func main() {
	box := tview.NewBox().SetBorder(true).SetTitle("Hello, world!")
	if err := tview.NewApplication().SetRoot(box, true).Run(); err != nil {
		panic(err)
	}
}

Check out the GitHub Wiki for more examples along with screenshots. Or try the examples in the "demos" subdirectory.

For a presentation highlighting this package, compile and run the program found in the "demos/presentation" subdirectory.

Projects using tview

Documentation

Refer to https://pkg.go.dev/github.com/rivo/tview for the package's documentation. Also check out the Wiki.

Dependencies

This package is based on github.com/gdamore/tcell (and its dependencies) as well as on github.com/rivo/uniseg.

Sponsor this Project

Become a Sponsor on GitHub to further this project!

Backwards-Compatibility

I try really hard to keep this project backwards compatible. Your software should not break when you upgrade tview. But this also means that some of its shortcomings that were present in the initial versions will remain. Having said that, backwards compatibility may still break when:

Your Feedback

Add your issue here on GitHub. Feel free to get in touch if you have any questions.

Code of Conduct

We follow Golang's Code of Conduct which you can find here.

tview (rivo/tview)

Searching Database…

14.1K ·GitHub
What is this?tview is a Go package that provides ready-made, interactive widgets for building terminal user interfaces: input forms, text views, text areas, tables, tree views, lists, images, layouts and modal windows.
Is it a framework or a library?It's a Go library you import into your own program, including an application wrapper that runs the event loop; it is not a standalone app.
How do I add it to a project?Add the package to your Go project with the standard Go module tooling (go get), then import it and use its 'Hello, World!' box example as a starting point.
What does tview depend on?It's built on top of github.com/gdamore/tcell for terminal handling and github.com/rivo/uniseg for Unicode text segmentation.
Will my code break on future upgrades?The author tries hard to keep tview backwards compatible, but breakage can still happen if tcell changes force it, if a bug is fixed, or if internal interfaces like Primitive change.
What widgets does tview include out of the box?Input forms with text fields, selections, checkboxes and buttons, multi-color text views, editable text areas, navigable tables, tree views, selectable lists, images, Flexbox/grid/page layouts and modal message windows.
Where can I see real examples of tview in use?The README lists dozens of real projects built with tview, like K9s (Kubernetes CLI), gh (GitHub CLI), lazysql, and podman-tui, plus a 'demos' subdirectory and a GitHub Wiki with screenshots.
Why is tview popular for CLI tool authors?It gives Go developers ready-made, customizable terminal widgets instead of building forms, tables and layouts from scratch, which is why many popular Go CLI tools (K9s, gh, ktop) adopted it.
Creator
rivo
Size
6.4 MB
Stars
14.1K
Age
8y
Commits · 90 Days