tui

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorReset  = "\x1b[0m"
	ColorRed    = "\x1b[31m"
	ColorGreen  = "\x1b[32m"
	ColorYellow = "\x1b[33m"
	ColorDim    = "\x1b[90m"
)

Variables

View Source
var DefaultFrames = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}

Functions

This section is empty.

Types

type Colorizer

type Colorizer struct {
	Enabled bool
}

func NewColorizer

func NewColorizer(enabled bool) Colorizer

func (Colorizer) Wrap

func (c Colorizer) Wrap(code, text string) string

type Spinner

type Spinner struct {
	// contains filtered or unexported fields
}

func NewSpinner

func NewSpinner(out io.Writer, opts ...SpinnerOption) *Spinner

func (*Spinner) Start

func (s *Spinner) Start(msg string)

func (*Spinner) Stop

func (s *Spinner) Stop(clear bool)

func (*Spinner) Update

func (s *Spinner) Update(msg string)

type SpinnerOption

type SpinnerOption func(*Spinner)

func WithColor

func WithColor(colorizer Colorizer, frameColor string) SpinnerOption

func WithFrames

func WithFrames(frames []string) SpinnerOption

func WithHideCursor

func WithHideCursor(hide bool) SpinnerOption

func WithInterval

func WithInterval(d time.Duration) SpinnerOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL