common

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: MIT Imports: 7 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ButtonView

func ButtonView(text string, focused bool) string

ButtonView renders something that resembles a button.

func CancelButtonView

func CancelButtonView(focused bool, defaultButton bool) string

CancelButtonView returns a button reading "Cancel.".

func HelpView

func HelpView(sections ...string) string

HelpView renders text intended to display at help text, often at the bottom of a view.

func IsTTY added in v0.9.0

func IsTTY() bool

Returns true if standard out is a terminal.

func KeyValueView

func KeyValueView(stuff ...string) string

KeyValueView renders key-value pairs.

func NewSpinner added in v0.9.0

func NewSpinner() spinner.Model

NewSpinner returns a spinner model.

func NoButtonView

func NoButtonView(focused bool) string

NoButtonView returns a button reading "No.".

func OKButtonView

func OKButtonView(focused bool, defaultButton bool) string

OKButtonView returns a button reading "OK".

func VerticalLine

func VerticalLine(state State) string

VerticalLine return a vertical line colored according to the given state.

func YesButtonView

func YesButtonView(focused bool) string

YesButtonView return a button reading "Yes".

Types

type State

type State int

State is a general UI state used to help style components.

const (
	StateNormal State = iota
	StateSelected
	StateActive
	StateSpecial
	StateDeleting
)

UI states.

type Styles added in v0.9.0

type Styles struct {
	Cursor,
	Wrap,
	Paragraph,
	Keyword,
	Code,
	Subtle,
	Error,
	Prompt,
	FocusedPrompt,
	Note,
	NoteDim,
	Delete,
	DeleteDim,
	Label,
	LabelDim,
	ListKey,
	ListDim,
	InactivePagination,
	SelectionMarker,
	SelectedMenuItem,
	Checkmark,
	App lipgloss.Style
}

Styles describes style definitions for various portions of the Charm TUI.

func DefaultStyles added in v0.9.0

func DefaultStyles() Styles

DefaultStyles returns default styles for the Charm TUI.

Jump to

Keyboard shortcuts

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