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
Trevor Slocum 89d24b0931 Add Table.Sort, Table.SetSortFunc and Table.SetSortClicked
Resolves #485.
4 years ago
demos Bugfix in Flex which led to a panic. 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 Minor fixes. Also added winman. 4 years ago
ansi.go Merge pull request #444 from mjwhitta/master 4 years ago
application.go Removed size change check (apparently this led to problems on Windows). Fixes #401, closes #404 4 years ago
borders.go added configurable borders 6 years ago
box.go Added getters for common Box attributes. Resolves #427 5 years ago
button.go Added/fixed comments, some structural changes/bugfixes for mouse support. Table, TextView, and TreeView still open. Closes #363 5 years ago
checkbox.go Added/fixed comments, some structural changes/bugfixes for mouse support. Table, TextView, and TreeView still open. Closes #363 5 years ago
doc.go Minor improvements. 6 years ago
dropdown.go Keyboard events are now propagated down the hierarchy, allowing users to intercept them. Closes #421 4 years ago
flex.go Bugfix in Flex which led to a panic. 4 years ago
focusable.go Added list, improved existing primitives, and fixed a bunch of bugs. 7 years ago
form.go Keyboard events are now propagated down the hierarchy, allowing users to intercept them. Closes #421 4 years ago
frame.go Keyboard events are now propagated down the hierarchy, allowing users to intercept them. Closes #421 4 years ago
go.mod Keyboard events are now propagated down the hierarchy, allowing users to intercept them. Closes #421 4 years ago
go.sum Keyboard events are now propagated down the hierarchy, allowing users to intercept them. Closes #421 4 years ago
grid.go Keyboard events are now propagated down the hierarchy, allowing users to intercept them. Closes #421 4 years ago
inputfield.go Fixed mouse/keyboard input issues with input fields and forms. Fixes #363 5 years ago
list.go Merge pull request #418 from abitrolly/patch-2 5 years ago
modal.go Keyboard events are now propagated down the hierarchy, allowing users to intercept them. Closes #421 4 years ago
pages.go Keyboard events are now propagated down the hierarchy, allowing users to intercept them. Closes #421 4 years ago
primitive.go Added/fixed comments, some structural changes/bugfixes for mouse support. Table, TextView, and TreeView still open. Closes #363 5 years ago
semigraphics.go Removed deprecated funcs/const related to semigraphic changes 6 years ago
styles.go Fixed some comments. 6 years ago
table.go Add Table.Sort, Table.SetSortFunc and Table.SetSortClicked 4 years ago
textview.go Keyboard events are now propagated down the hierarchy, allowing users to intercept them. Closes #421 4 years ago
treeview.go Also call node.selected on node click 4 years ago
tview.gif Added links to Wiki to documentation. Also replaced screenshot with GIF screencast. 7 years ago
util.go Bugfix in string decomposition: Escape sequences cannot be handled after the fact. Fixes #448 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.

Projects using tview

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.