A UI library for terminal applications.
Switch branches/tags
Clone or download
Permalink
Failed to load latest commit information.
example chat: Set history to autoscroll Feb 27, 2018
wordwrap Remove unused assignment to spaceLeft Jan 3, 2018
.gitignore added ResetKeybindings() to reset keybindings Dec 29, 2017
.travis.yml travis: update go versions Nov 3, 2017
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Nov 3, 2017
CONTRIBUTING.md Create CONTRIBUTING.md Nov 3, 2017
LICENSE Initial commit Nov 17, 2016
README.md Update README.md Feb 27, 2018
box.go Use max int value for current architecture Feb 24, 2018
box_test.go Add surface test helper Feb 5, 2018
button.go Improve documentation Jun 11, 2017
button_test.go Add surface test helper Feb 5, 2018
cjk_test.go Add surface test helper Feb 5, 2018
doc.go Overhaul layout engine Apr 29, 2017
entry.go Added KeyBackspace case for entry and text_edit widgets. Feb 26, 2018
entry_test.go Add surface test helper Feb 5, 2018
event.go Bring key mappings up to date with tcell Jul 26, 2017
focus.go Improve documentation Jun 11, 2017
grid.go Use max int value for current architecture Feb 24, 2018
grid_test.go Fix size hint for tables with columns of uneven size Feb 24, 2018
keybinding.go Unexport stuff that need not be exported Jun 8, 2017
keybinding_test.go Unexport stuff that need not be exported Jun 8, 2017
label.go Factor wrappedText and fix tests. Jan 3, 2018
label_sizehint_test.go Add test that fails when sizehint isn't reset Dec 24, 2017
label_test.go Add surface test helper Feb 5, 2018
list.go Add more documentation Sep 25, 2017
list_test.go Fix travis build Feb 5, 2018
logger.go Add Logger interface Jan 6, 2018
math.go Use max int value for current architecture Feb 24, 2018
padder.go Update docstring on Padder Dec 29, 2017
painter.go Add functions for scrolling to top and bottom Feb 27, 2018
painter_test.go Add surface test helper Feb 5, 2018
progress.go Add missing documentation Sep 25, 2017
progress_test.go Add surface test helper Feb 5, 2018
runebuf.go golint Nov 25, 2017
runebuf_test.go Implement whitespace preserving wordwrap Nov 18, 2017
scroll_area.go Add functions for scrolling to top and bottom Feb 27, 2018
scroll_area_test.go Add functions for scrolling to top and bottom Feb 27, 2018
spacer.go Clean up widgets May 1, 2017
statusbar.go Add missing documentation Sep 25, 2017
table.go Fix Table widget bug Jan 21, 2018
table_test.go Add surface test helper Feb 5, 2018
testing.go Add surface test helper Feb 5, 2018
text.go gofmt simplify Nov 27, 2016
text_edit.go Added KeyBackspace case for entry and text_edit widgets. Feb 26, 2018
text_edit_test.go Add surface test helper Feb 5, 2018
text_test.go Add support for wide characters Nov 26, 2016
theme.go Change Type Color int to int64 Jan 4, 2018
theme_test.go Make Style's stacking behavior explicit. Dec 24, 2017
ui.go add Repaint() to UI interface Jun 16, 2018
ui_tcell.go add Repaint() to UI interface Jun 16, 2018
widget.go Add more documentation Sep 25, 2017

README.md

tui: Terminal UI for Go

Build Status GoDoc Go Report Card License MIT

A UI library for terminal applications.

tui (pronounced tooey) provides a higher-level programming model for building rich terminal applications. It lets you build layout-based user interfaces that (should) gracefully handle resizing for you.

IMPORTANT: tui-go is still in an experimental phase so please don't use it for anything other than experiments, yet.

Update: I created tui-go as an experiment because I wanted a simpler way of creating terminal-based user interfaces. It has since then become a project, with all the work that comes with it. While it's been really fun, unfortunately I'm no longer able to maintain this project.

Since I started working on tui-go, a number of similar projects have popped up. One that I think shows great promise is rivo/tview, which embodies much of what I envisioned for tui-go. I highly recommend trying it out!

Thanks all of you who have contributed and supported tui-go!

Screenshot

Installation

go get github.com/marcusolsson/tui-go

Usage

package main

import "github.com/marcusolsson/tui-go"

func main() {
	box := tui.NewVBox(
		tui.NewLabel("tui-go"),
	)

	ui, err := tui.New(box)
	if err != nil {
		panic(err)
	}
	ui.SetKeybinding("Esc", func() { ui.Quit() })

	if err := ui.Run(); err != nil {
		panic(err)
	}
}

Getting started

If you want to know what it is like to build terminal applications with tui-go, check out some of the examples.

Documentation is available at godoc.org.

Make sure you check out some of the projects using tui-go.

Once you've gotten started developing your first application with tui-go, you might be interested in learning about common patterns or how you can debug your applications.

Related projects

tui-go is mainly influenced by Qt and offers a similar programming model that has been adapted to Go and the terminal.

For an overview of the alternatives for writing terminal user interfaces, check out this article by AppliedGo.

License

tui-go is released under the MIT License.

Contact

If you're interested in chatting with users and contributors, join #tui-go on the Gophers Slack. If you're not already a part of the Slack workspace, you can join here. If you prefer a lower-bandwidth interface, see this article on connecting to Slack via IRC or XMPP.