termui

Golang terminal dashboard

  • 所有者: gizak/termui
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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

主要指标

概览
名称与所有者gizak/termui
主编程语言Go
编程语言Go (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2015-02-03 14:09:27
推送于2024-07-22 21:41:39
最后一次提交2024-01-30 14:40:22
发布数5
最新版本名称v3.1.0 (发布于 )
第一版名称v2.1.1 (发布于 2016-11-03 17:42:36)
用户参与
星数13.4k
关注者数285
派生数799
提交数398
已启用问题?
问题数222
打开的问题数80
拉请求数63
打开的拉请求数25
关闭的拉请求数25
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?