termui

Golang terminal dashboard

  • Owner: gizak/termui
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

termui

termui is a cross-platform and fully-customizable terminal dashboard and widget library built on top of termbox-go. It is inspired by blessed-contrib and tui-rs and written purely in Go.

Features

  • Several premade widgets for common use cases
  • Easily create custom widgets
  • Position widgets either in a relative grid or with absolute coordinates
  • Keyboard, mouse, and terminal resizing events
  • Colors and styling

Installation

Go modules

It is not necessary to go get termui, since Go will automatically manage any imported dependencies for you. Do note that you have to include /v3 in the import statements as shown in the 'Hello World' example below.

Dep

Add with dep ensure -add github.com/gizak/termui. With Dep, /v3 should not be included in the import statements.

Hello World

package main

import (
	"log"

	ui "github.com/gizak/termui/v3"
	"github.com/gizak/termui/v3/widgets"
)

func main() {
	if err := ui.Init(); err != nil {
		log.Fatalf("failed to initialize termui: %v", err)
	}
	defer ui.Close()

	p := widgets.NewParagraph()
	p.Text = "Hello World!"
	p.SetRect(0, 0, 25, 5)

	ui.Render(p)

	for e := range ui.PollEvents() {
		if e.Type == ui.KeyboardEvent {
			break
		}
	}
}

Widgets

Run an example with go run _examples/{example}.go or run each example consecutively with make run-examples.

Documentation

Uses

License

MIT

Main metrics

Overview
Name With Ownergizak/termui
Primary LanguageGo
Program languageGo (Language Count: 3)
Platform
License:MIT License
所有者活动
Created At2015-02-03 14:09:27
Pushed At2024-07-22 21:41:39
Last Commit At2024-01-30 14:40:22
Release Count5
Last Release Namev3.1.0 (Posted on )
First Release Namev2.1.1 (Posted on 2016-11-03 17:42:36)
用户参与
Stargazers Count13.4k
Watchers Count285
Fork Count799
Commits Count398
Has Issues Enabled
Issues Count222
Issue Open Count80
Pull Requests Count63
Pull Requests Open Count25
Pull Requests Close Count25
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private