ui

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Title   = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("#62d6b9"))
	Accent  = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("#f7a400"))
	Info    = lipgloss.NewStyle().Foreground(lipgloss.Color("#7d56f4"))
	Error   = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("#f25d94"))
	Success = lipgloss.NewStyle().Foreground(lipgloss.Color("#2ecc71"))
	Dim     = lipgloss.NewStyle().Foreground(lipgloss.Color("#666666"))
)

Palette matches scripts/fetch-transcript and scripts/migrations.

Functions

func Banner(text string) string

Banner prints a styled title line with a leading newline.

func Confirm

func Confirm(question string, defaultYes bool) (bool, error)

Confirm asks a yes/no question. Returns true on yes, false on no, error on cancel.

func Errorln

func Errorln(err error) string

Errorln formats a red error message to stderr-style string.

func Form

func Form(title string, fields []FormField) ([]string, error)

Form runs a multi-field form and returns each field's final value (in order).

func Hint

func Hint(msg string) string

Hint prints a dimmed hint line.

func Infoln

func Infoln(msg string) string

Infoln formats a dimmed info message.

func Pick

func Pick(title string, options []PickerOption) (string, error)

Pick shows a list of options and returns the chosen Label.

func Prompt

func Prompt(label, placeholder, initial string, validate func(string) error) (string, error)

Prompt asks the user for a single line of text. validate may be nil.

func Slugify

func Slugify(s string) string

Slugify converts free-form text into a valid slug.

func Step

func Step(format string, a ...any) string

Step prints a "→ <step>" line in accent color.

func Successln

func Successln(msg string) string

Successln formats a green success message.

func ValidateSlug

func ValidateSlug(s string) error

SlugRegex validates a kebab-case slug.

Types

type FormField

type FormField struct {
	Label    string
	Initial  string
	Multi    bool // true → textarea, false → single-line textinput
	Required bool
}

FormField describes a single input on the PR form.

type PickerOption

type PickerOption struct {
	Label string
	Hint  string // optional one-line description
}

PickerOption is a single choice in a picker.

Jump to

Keyboard shortcuts

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