Terminal UI library with rich, interactive widgets — written in Golang
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Chris Miller 77ccc1ff41 Allow changing current node during handler
Avoids wrong handler being called or even crash on nil
4 years ago
demos Added mouse support to presentation demo. TextView "highlighted" callback also receives remaining highlights. 4 years ago
CODE_OF_CONDUCT.md Added a contact link to code of conduct. 7 years ago
CONTRIBUTING.md Added a clarifying note to the contributing guidelines. 5 years ago
LICENSE.txt Replaced license placeholders. Fixes #149 6 years ago
README.md Don't forward mouse events to nil items in Flex/Grid. Fixes #425 4 years ago
ansi.go ANSI parser now also handles SGR 39 and 49. Fixes #347 5 years ago
application.go Added mouse scrolling to List, Table, TextView, and TreeView. 4 years ago
borders.go added configurable borders 6 years ago
box.go Added getters for common Box attributes. Resolves #427 4 years ago
button.go Added/fixed comments, some structural changes/bugfixes for mouse support. Table, TextView, and TreeView still open. Closes #363 4 years ago
checkbox.go Added/fixed comments, some structural changes/bugfixes for mouse support. Table, TextView, and TreeView still open. Closes #363 4 years ago
doc.go Minor improvements. 6 years ago
dropdown.go Added mouse support for Table and TreeView. 4 years ago
flex.go Don't forward mouse events to nil items in Flex/Grid. Fixes #425 4 years ago
focusable.go Added list, improved existing primitives, and fixed a bunch of bugs. 7 years ago
form.go Fixed mouse/keyboard input issues with input fields and forms. Fixes #363 4 years ago
frame.go Added/fixed comments, some structural changes/bugfixes for mouse support. Table, TextView, and TreeView still open. Closes #363 4 years ago
go.mod Update dependencies colorful and runewidth 4 years ago
go.sum Update dependencies colorful and runewidth 4 years ago
grid.go Don't forward mouse events to nil items in Flex/Grid. Fixes #425 4 years ago
inputfield.go Fixed mouse/keyboard input issues with input fields and forms. Fixes #363 4 years ago
list.go Merge pull request #418 from abitrolly/patch-2 4 years ago
modal.go Added/fixed comments, some structural changes/bugfixes for mouse support. Table, TextView, and TreeView still open. Closes #363 4 years ago
pages.go Added/fixed comments, some structural changes/bugfixes for mouse support. Table, TextView, and TreeView still open. Closes #363 4 years ago
primitive.go Added/fixed comments, some structural changes/bugfixes for mouse support. Table, TextView, and TreeView still open. Closes #363 4 years ago
semigraphics.go Removed deprecated funcs/const related to semigraphic changes 6 years ago
styles.go Fixed some comments. 5 years ago
table.go Merge pull request #403 from tslocum/scrolltable 4 years ago
textview.go TextView changed function is always called in a separate goroutine to avoid deadlocks. Fixes #416 4 years ago
treeview.go Allow changing current node during handler 4 years ago
tview.gif Added links to Wiki to documentation. Also replaced screenshot with GIF screencast. 7 years ago
util.go The inner area of a Box does not clamp to screen borders anymore. Consequently added some drawing optimization to primitives. Resolves #405 4 years ago

README.md

Rich Interactive Widgets for Terminal UIs

Godoc Reference Go Report

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

Screenshot

Among these components are:

  • Input forms (include input/password fields, drop-down selections, checkboxes, and buttons)
  • Navigable multi-color text views
  • Sophisticated navigable table views
  • Flexible tree views
  • Selectable lists
  • Grid, Flexbox and page layouts
  • Modal message windows
  • An application wrapper

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

Installation

go get github.com/rivo/tview

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.

Documentation

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

Dependencies

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

Your Feedback

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