styles

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FooterLine         = BoldText("│ ", Gray)
	FooterCommands     = []string{"Enter", "Ctrl+c", "q", "Ctrl+z", "Ctrl+t", "Space", "arrow-keys"}
	HiddenMnemonicText = Text("*Mnemonic has been entered and is now hidden for security purposes.*", Ivory)
)
View Source
var (
	QuestionMark    = Text("? ", Cyan)
	CorrectMark     = Text("✓ ", Green)
	InformationMark = Text("i ", Cyan)
	SelectorCursor  = Text("> ", Cyan)
)
View Source
var (
	NoSeparator    = ""
	ArrowSeparator = Text(" > ", Gray)
	DotsSeparator  = Text(" ... ", Gray)
)

Functions

func BoldText

func BoldText(text string, color HexColor) string

BoldText applies bold and color styling to a string

func BoldUnderlineText

func BoldUnderlineText(text string, color HexColor) string

func CreateFrame

func CreateFrame(text string, maxWidth int) string

func Cursor

func Cursor(cursorChar string) string

func DefaultTextWithoutOverridingStyledText

func DefaultTextWithoutOverridingStyledText(text string) string

DefaultTextWithoutOverridingStyledText is a helper function to apply default styling without overriding existing styles

func FadeText

func FadeText(text string) string

func NewWordwrapWriter added in v0.1.0

func NewWordwrapWriter(limit int) *wordwrap.WordWrap

func RenderError

func RenderError(err error) string

func RenderFooter

func RenderFooter(text string) string

func RenderKey added in v0.1.2

func RenderKey(keyName, address string) string

func RenderPreviousResponse

func RenderPreviousResponse(separator string, question string, highlights []string, answer string) string

func RenderPrompt

func RenderPrompt(text string, highlights []string, status PromptStatus) string

RenderPrompt highlights phrases in the text if they match any phrase in the highlight list

func SetBoldColor

func SetBoldColor(text string, color HexColor) string

func SetBoldUnderlineColor

func SetBoldUnderlineColor(text string, color HexColor) string

func SetColor

func SetColor(text string, color HexColor) string

func StripANSI

func StripANSI(text string) string

func Text

func Text(text string, color HexColor) string

Text applies a hex color to a given string and returns the styled string

func TextWithoutOverridingStyledText

func TextWithoutOverridingStyledText(text string, color HexColor) string

func WordwrapBytes added in v0.1.0

func WordwrapBytes(b []byte, limit int) []byte

func WordwrapString added in v0.1.0

func WordwrapString(s string, limit int) string

Types

type HexColor

type HexColor string
const (
	White     HexColor = "#F5F5F5"
	Ivory     HexColor = "#CBCBCB"
	Cyan      HexColor = "#27D8FF"
	DarkCyan  HexColor = "#178299"
	Green     HexColor = "#B0EE5F"
	LightGray HexColor = "#AAAAAA"
	Gray      HexColor = "#808080"
	Black     HexColor = "#000000"
	Yellow    HexColor = "#FFBE5E"
)

type PromptStatus

type PromptStatus string
const (
	Empty       PromptStatus = "empty"
	Checked     PromptStatus = "checked"
	Question    PromptStatus = "question"
	Information PromptStatus = "information"
	Completed   PromptStatus = "completed"
)

Jump to

Keyboard shortcuts

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