tui

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ask

func Ask(logger logger.Logger, title string, defaultValue bool) bool

func Body

func Body(text string) string

func Bold

func Bold(text string) string

func ClearScreen

func ClearScreen()

ClearScreen clears the screen and moves the cursor to the top left corner

func Command

func Command(cmd string, args ...string) string

func Directory

func Directory(dir string, args ...string) string

func Input

func Input(logger logger.Logger, title string, description string) string

func InputWithPlaceholder

func InputWithPlaceholder(logger logger.Logger, title string, description string, placeholder string) string

func InputWithValidation

func InputWithValidation(logger logger.Logger, title string, description string, maxLength int, validate func(string) error) string
func Link(url string, args ...any) string
func Logo()

func MaxWidth

func MaxWidth(text string, width int) string

func MultiSelect

func MultiSelect(logger logger.Logger, title string, description string, items []Option) []string

MultiSelect will display a multi-select list of items and return the selected items

func Muted

func Muted(text string) string

func PadLeft

func PadLeft(str string, length int, pad string) string

func PadRight

func PadRight(str string, length int, pad string) string

func Padding

func Padding(text string) string

func Paragraph

func Paragraph(text string, lines ...string) string

func Password

func Password(logger logger.Logger, title string, description string) string

func Secondary

func Secondary(text string) string

func Select

func Select(logger logger.Logger, title string, description string, items []Option) string

func ShowBanner

func ShowBanner(title string, body string, clearScreen bool)

func ShowLock

func ShowLock(msg string, args ...any)

func ShowSpinner

func ShowSpinner(logger logger.Logger, title string, action func())

ShowSpinner will display a spinner while the action is being performed

func ShowSuccess

func ShowSuccess(msg string, args ...any)

func ShowWarning

func ShowWarning(msg string, args ...any)

func Table

func Table(headers []string, rows [][]string)

func Text

func Text(val string) string

func Title

func Title(text string) string

func TitleColor

func TitleColor() lipgloss.AdaptiveColor

func WaitForAnyKey added in v0.0.30

func WaitForAnyKey()

func Warning

func Warning(text string) string

Types

type Option

type Option struct {
	ID       string
	Text     string
	Selected bool
}

Jump to

Keyboard shortcuts

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