Uxtm: a basic TUI library in go

I’ve built a basic TUI (text user interface) library in go: pkg.go.dev.

The library currently supports the following widget types:

  • Sliders

  • Checkboxes

It includes event handling for sliders and checkboxes (buttons aren’t supported yet), allowing you to respond to user interactions.

Here’s a simple example application built with it:

package main

import (

    "github.com/Pjdur/uxtm"
)

func main() {
    ui := uxtm.New("My TUI App")

    checkbox := uxtm.NewCheckbox("Options", []string{"Option 1", "Option 2", "Option 3"})
    slider := uxtm.NewSlider("Volume", 0, 100, 50)

    ui.View().Add(checkbox, slider)

    ui.Run()
}

Feedback or suggestions are welcome.

version 1.2.0 is now out. This version now has the input component. This is a basic implementation:

package main

import (
	"log"

	"github.com/Pjdur/uxtm"
)

func main() {
	ui := uxtm.New("Test Input Component")

	input := uxtm.NewInput("title")
     checkbox := uxtm.NewCheckbox("Options", []string{"Option 1", "Option 2", "Option 3"})
    slider := uxtm.NewSlider("Volume", 0, 100, 50)

	ui.View().Add(input)

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

feedback and contribution are welcome