Documentation
¶
Overview ¶
Package tui provides shared TUI components for Lango CLI commands.
Index ¶
- Constants
- Variables
- func Banner() string
- func BannerBox() string
- func Breadcrumb(segments ...string) string
- func FormatFail(msg string) string
- func FormatMuted(msg string) string
- func FormatPass(msg string) string
- func FormatWarn(msg string) string
- func GetVersion() string
- func HelpBar(entries ...string) string
- func HelpEntry(key, label string) string
- func KeyBadge(key string) string
- func ServeBanner() string
- func SetProfile(name string)
- func SetVersionInfo(version, buildTime string)
- func StartupSummary(features []FeatureLine) string
- type FeatureLine
Constants ¶
View Source
const ( CheckPass = "✓" CheckWarn = "⚠" CheckFail = "✗" Spinner = "◌" )
Check result indicators
Variables ¶
View Source
var ( Primary = lipgloss.Color("#7C3AED") // Purple Success = lipgloss.Color("#10B981") // Green Warning = lipgloss.Color("#F59E0B") // Amber Error = lipgloss.Color("#EF4444") // Red Muted = lipgloss.Color("#6B7280") // Gray Foreground = lipgloss.Color("#F9FAFB") // White Background = lipgloss.Color("#1F2937") // Dark gray Highlight = lipgloss.Color("#3B82F6") // Blue Accent = lipgloss.Color("#04B575") // Green (selection/focus) Dim = lipgloss.Color("#626262") // Dim gray (descriptions) Separator = lipgloss.Color("#374151") // Dark gray (dividers) )
Color palette for consistent theming
View Source
var ( // TitleStyle for main headers TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(Primary). MarginBottom(1) // SubtitleStyle for secondary headers SubtitleStyle = lipgloss.NewStyle(). Foreground(Muted). MarginBottom(1) // SuccessStyle for success messages SuccessStyle = lipgloss.NewStyle(). Foreground(Success) // WarningStyle for warning messages WarningStyle = lipgloss.NewStyle(). Foreground(Warning) // ErrorStyle for error messages ErrorStyle = lipgloss.NewStyle(). Foreground(Error) // MutedStyle for less important text MutedStyle = lipgloss.NewStyle(). Foreground(Muted) // HighlightStyle for emphasized text HighlightStyle = lipgloss.NewStyle(). Foreground(Highlight). Bold(true) // BoxStyle for bordered containers BoxStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(Muted). Padding(1, 2) // ListItemStyle for list items ListItemStyle = lipgloss.NewStyle(). PaddingLeft(2) // SelectedItemStyle for selected list items SelectedItemStyle = lipgloss.NewStyle(). PaddingLeft(2). Foreground(Primary). Bold(true) // SectionHeaderStyle for menu section titles SectionHeaderStyle = lipgloss.NewStyle(). Foreground(Highlight). Bold(true). PaddingLeft(2) // SeparatorLineStyle for section dividers SeparatorLineStyle = lipgloss.NewStyle(). Foreground(Separator) // CursorStyle for the selection arrow CursorStyle = lipgloss.NewStyle(). Foreground(Accent) // ActiveItemStyle for highlighted/selected items ActiveItemStyle = lipgloss.NewStyle(). Foreground(Accent). Bold(true) // SearchBarStyle for the search input container SearchBarStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(Primary). Padding(0, 1) // FormTitleBarStyle for form titles FormTitleBarStyle = lipgloss.NewStyle(). Bold(true). Foreground(Primary). Border(lipgloss.NormalBorder(), false, false, true, false). BorderForeground(Primary). MarginBottom(1) // FieldDescStyle for field description/help text FieldDescStyle = lipgloss.NewStyle(). Foreground(Dim). Italic(true). PaddingLeft(2) // BadgeAdvancedStyle for the ADV badge on advanced categories BadgeAdvancedStyle = lipgloss.NewStyle(). Foreground(Foreground). Background(Muted). Bold(true). Padding(0, 1) // BadgeDependencyStyle for the dependency warning badge on categories BadgeDependencyStyle = lipgloss.NewStyle(). Foreground(Foreground). Background(Warning). Bold(true). Padding(0, 1) )
Base styles for TUI components
Functions ¶
func BannerBox ¶
func BannerBox() string
BannerBox wraps the Banner in a rounded border box (for settings welcome).
func Breadcrumb ¶
Breadcrumb renders a navigation path like "Settings > Agent Configuration".
func GetVersion ¶ added in v0.6.0
func GetVersion() string
GetVersion returns the current version string.
func ServeBanner ¶
func ServeBanner() string
ServeBanner returns a banner for the serve command with a separator line.
func SetVersionInfo ¶
func SetVersionInfo(version, buildTime string)
SetVersionInfo injects version and build time from main.go.
func StartupSummary ¶ added in v0.6.0
func StartupSummary(features []FeatureLine) string
StartupSummary renders activated features based on config flags. Each entry is a key string mapped to an enabled bool and optional detail.
Types ¶
type FeatureLine ¶ added in v0.6.0
FeatureLine describes a single feature for startup summary.
Click to show internal directories.
Click to hide internal directories.