cliui

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: CC0-1.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Green   = Color("#04B575")
	Red     = Color("#ED567A")
	Fuchsia = Color("#EE6FF8")
	Yellow  = Color("#ECFD65")
	Blue    = Color("#5000ff")
)
View Source
var Canceled = xerrors.New("canceled")

Functions

func Bold

func Bold(s string) string

Bold returns a formatter that renders text in bold if the terminal supports it.

func BoldFmt

func BoldFmt() pretty.Formatter

BoldFmt returns a formatter that renders text in bold if the terminal supports it.

func Code

func Code(s string) string

Code formats code for display.

func Color

func Color(s string) termenv.Color

Color returns a color for the given string.

func Field

func Field(s string) string

Field formats a field for display.

func Keyword

func Keyword(s string) string

Keyword formats a keyword for display.

func Placeholder

func Placeholder(s string) string

Placeholder formats a placeholder for display.

func Timestamp

func Timestamp(t time.Time) string

Timestamp formats a timestamp for display.

func ValidateNotEmpty

func ValidateNotEmpty(s string) error

ValidateNotEmpty is a helper function to disallow empty inputs!

func Wrap

func Wrap(s string) string

Wrap prevents the text from overflowing the terminal.

Types

type Styles

type Styles struct {
	Code,
	DateTimeStamp,
	Error,
	Field,
	Keyword,
	Placeholder,
	Prompt,
	FocusedPrompt,
	Fuchsia,
	Warn,
	Wrap pretty.Style
}
var DefaultStyles Styles

DefaultStyles compose visual elements of the UI.

Jump to

Keyboard shortcuts

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