cliui

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: CC0-1.0 Imports: 7 Imported by: 0

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,
	Disabled,
	Enabled 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