Documentation
¶
Index ¶
- Variables
- func Box(title, content string, width int) string
- func CenterPad(text string, width int) string
- func CenterText(text string, width int) string
- func ColorSwatchStyle(color string) lipgloss.Style
- func Confirm(title, message string, confirmKey, cancelKey string) string
- func CountBadge(count int) string
- func Footer(keys [][]string, width int) string
- func FooterWithHints(hints []KeyHint, width int) string
- func GetStatusStyle(status string) lipgloss.Style
- func GroupBadge(name string, color string) string
- func Header(title string, width int) string
- func HorizontalLine(width int) string
- func LabelValue(label, value string) string
- func RenderDropdown(label string, options []string, selected int, focused bool) string
- func RenderDropdownExpanded(label string, options []string, selected int, highlighted int) string
- func Section(title string, content string, width int) string
- func StatusBadge(status string) string
- func StatusIcon(status string) string
- func Truncate(s string, maxLen int) string
- func WordWrap(text string, width int) string
- type KeyHint
Constants ¶
This section is empty.
Variables ¶
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
var ( PendingColor = lipgloss.Color("#9aa5ce") // muted (brighter) InProgressColor = lipgloss.Color("#7aa2f7") // blue CompletedColor = lipgloss.Color("#9ece6a") // green )
Status colors
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
var ( PendingStyle = lipgloss.NewStyle(). Foreground(PendingColor) InProgressStyle = lipgloss.NewStyle(). Foreground(InProgressColor) CompletedStyle = lipgloss.NewStyle(). Foreground(CompletedColor) )
Status styles
var ( TaskItemStyle = lipgloss.NewStyle() TaskSelectedStyle = lipgloss.NewStyle(). Bold(true). Foreground(Primary) BlockedByStyle = lipgloss.NewStyle(). Foreground(Muted). PaddingLeft(4). Italic(true) )
Task item styles
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
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
var FilterBarStyle = lipgloss.NewStyle(). Foreground(Muted). Padding(0, 0, 1, 0)
Filter bar style
var GroupHeaderStyle = lipgloss.NewStyle(). Bold(true). Foreground(Foreground)
Group header style
var SpinnerFrames = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
Spinner characters for loading animation
Functions ¶
func CenterPad ¶ added in v1.2.0
CenterPad centers text within a given width with padding on both sides
func CenterText ¶
CenterText centers text within a given width
func FooterWithHints ¶
FooterWithHints renders help footer with disabled keys grayed out and auto line wrapping
func GetStatusStyle ¶
GetStatusStyle returns the appropriate style for a status
func GroupBadge ¶
GroupBadge renders a colored group badge
func HorizontalLine ¶
Horizontal line (avoid lipgloss.Render to prevent width miscalculation)
func LabelValue ¶
LabelValue renders a label: value pair
func RenderDropdown ¶
RenderDropdown renders a dropdown selector
func RenderDropdownExpanded ¶
RenderDropdownExpanded renders an expanded dropdown
func StatusBadge ¶
StatusBadge renders a status badge with icon