ui

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Primary     = lipgloss.Color("#9d7cd8") // purple (softer)
	Secondary   = lipgloss.Color("#7aa2f7") // blue
	Success     = lipgloss.Color("#9ece6a") // green
	Warning     = lipgloss.Color("#e0af68") // yellow
	Danger      = lipgloss.Color("#f7768e") // red
	Muted       = lipgloss.Color("#9aa5ce") // comment gray (much brighter)
	Background  = lipgloss.Color("#2f3549") // background (lighter)
	Foreground  = lipgloss.Color("#c0caf5") // foreground
	BorderColor = lipgloss.Color("#6b7089") // selection (brighter)
	Cyan        = lipgloss.Color("#7dcfff") // cyan
)

Tokyo Night Light variant

View Source
var (
	PendingColor    = lipgloss.Color("#9aa5ce") // muted (brighter)
	InProgressColor = lipgloss.Color("#7aa2f7") // blue
	CompletedColor  = lipgloss.Color("#9ece6a") // green
)

Status colors

View Source
var (
	// App container (vertical padding only, horizontal handled by content)
	AppStyle = lipgloss.NewStyle().
				PaddingTop(1).
				PaddingBottom(1)

	// Title bar (softer, no heavy background)
	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(Primary).
				Padding(0, 0)

	// Subtitle
	SubtitleStyle = lipgloss.NewStyle().
					Foreground(Muted).
					Italic(true)

	// Border box
	BoxStyle = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(BorderColor).
				Padding(1, 2)

	// Selected item
	SelectedStyle = lipgloss.NewStyle().
					Bold(true).
					Foreground(Primary)

	// Normal item
	NormalStyle = lipgloss.NewStyle().
				Foreground(Foreground)

	// Muted text
	MutedStyle = lipgloss.NewStyle().
				Foreground(Muted)

	// Disabled text (darker than muted)
	DisabledStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#6b7089"))

	// Help text
	HelpStyle = lipgloss.NewStyle().
				Foreground(Muted).
				Padding(1, 0)

	// Key style for help
	KeyStyle = lipgloss.NewStyle().
				Foreground(Primary).
				Bold(true)

	// Value style for details
	ValueStyle = lipgloss.NewStyle().
				Foreground(Foreground)

	// Label style for details
	LabelStyle = lipgloss.NewStyle().
				Foreground(Muted).
				Width(12)

	// Error style
	ErrorStyle = lipgloss.NewStyle().
				Foreground(Danger).
				Bold(true)

	// Success style
	SuccessStyle = lipgloss.NewStyle().
					Foreground(Success).
					Bold(true)

	// Warning style
	WarningStyle = lipgloss.NewStyle().
					Foreground(Warning)
)

Base styles

View Source
var (
	PendingStyle = lipgloss.NewStyle().
					Foreground(PendingColor)

	InProgressStyle = lipgloss.NewStyle().
					Foreground(InProgressColor)

	CompletedStyle = lipgloss.NewStyle().
					Foreground(CompletedColor)
)

Status styles

View Source
var (
	TaskItemStyle = lipgloss.NewStyle()

	TaskSelectedStyle = lipgloss.NewStyle().
						Bold(true).
						Foreground(Primary)

	BlockedByStyle = lipgloss.NewStyle().
					Foreground(Muted).
					PaddingLeft(4).
					Italic(true)
)

Task item styles

View Source
var (
	DialogBoxStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(Primary).
					Padding(1, 2).
					Width(60)

	DialogTitleStyle = lipgloss.NewStyle().
						Bold(true).
						Foreground(Primary).
						MarginBottom(1)

	ButtonStyle = lipgloss.NewStyle().
				Foreground(Foreground).
				Background(Muted).
				Padding(0, 2)

	ActiveButtonStyle = lipgloss.NewStyle().
						Foreground(Foreground).
						Background(Primary).
						Padding(0, 2)
)

Dialog styles

View Source
var (
	InputStyle = lipgloss.NewStyle().
				Foreground(Muted)

	FocusedInputStyle = lipgloss.NewStyle().
						Foreground(Foreground)

	InputLabelStyle = lipgloss.NewStyle().
					Foreground(Muted).
					MarginBottom(0)
)

Input styles - no borders to avoid conflicts with bubbles components

View Source
var FilterBarStyle = lipgloss.NewStyle().
	Foreground(Muted).
	Padding(0, 0, 1, 0)

Filter bar style

View Source
var GroupHeaderStyle = lipgloss.NewStyle().
	Bold(true).
	Foreground(Foreground)

Group header style

View Source
var SpinnerFrames = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}

Spinner characters for loading animation

Functions

func Box

func Box(title, content string, width int) string

Box renders content in a box

func CenterPad added in v1.2.0

func CenterPad(text string, width int) string

CenterPad centers text within a given width with padding on both sides

func CenterText

func CenterText(text string, width int) string

CenterText centers text within a given width

func ColorSwatchStyle

func ColorSwatchStyle(color string) lipgloss.Style

Color swatch style

func Confirm

func Confirm(title, message string, confirmKey, cancelKey string) string

Confirm renders a confirmation dialog

func CountBadge

func CountBadge(count int) string

CountBadge renders a count badge

func Footer(keys [][]string, width int) string

Footer renders the help footer with auto line wrapping

func FooterWithHints

func FooterWithHints(hints []KeyHint, width int) string

FooterWithHints renders help footer with disabled keys grayed out and auto line wrapping

func GetStatusStyle

func GetStatusStyle(status string) lipgloss.Style

GetStatusStyle returns the appropriate style for a status

func GroupBadge

func GroupBadge(name string, color string) string

GroupBadge renders a colored group badge

func Header(title string, width int) string

Header renders the application header

func HorizontalLine

func HorizontalLine(width int) string

Horizontal line (avoid lipgloss.Render to prevent width miscalculation)

func LabelValue

func LabelValue(label, value string) string

LabelValue renders a label: value pair

func RenderDropdown

func RenderDropdown(label string, options []string, selected int, focused bool) string

RenderDropdown renders a dropdown selector

func RenderDropdownExpanded

func RenderDropdownExpanded(label string, options []string, selected int, highlighted int) string

RenderDropdownExpanded renders an expanded dropdown

func Section

func Section(title string, content string, width int) string

Section renders a section with title

func StatusBadge

func StatusBadge(status string) string

StatusBadge renders a status badge with icon

func StatusIcon

func StatusIcon(status string) string

StatusIcon returns the icon for a status

func Truncate

func Truncate(s string, maxLen int) string

Truncate truncates a string to max length with ellipsis

func WordWrap

func WordWrap(text string, width int) string

WordWrap wraps text to fit within width

Types

type KeyHint

type KeyHint struct {
	Key     string
	Desc    string
	Enabled bool
}

KeyHint represents a key binding with enabled state

Jump to

Keyboard shortcuts

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