tui

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActiveThemeIdx int
View Source
var BrandGradient []lipgloss.Color
View Source
var SpinnerFrames = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
View Source
var Themes = []Theme{
	gruvbox,
	catppuccinMocha,
	dracula,
	nord,
	tokyoNight,
	synthwave,
	oneDark,
	solarizedDark,
	monokai,
	everforest,
	kanagawa,
	rosePine,
	ayuDark,
	nightfox,
}

Functions

func ASCIIBanner

func ASCIIBanner(frame int) string

func CategoryTag

func CategoryTag(emoji, label string) string

func CycleTheme

func CycleTheme() string

func DetailTabs

func DetailTabs(snap core.QuotaSnapshot) []string

func MetaTag

func MetaTag(icon, text string) string

func MetaTagHighlight

func MetaTagHighlight(icon, text string) string

func ModelColor

func ModelColor(idx int) lipgloss.Color

func ProviderColor

func ProviderColor(providerID string) lipgloss.Color

func PulseChar

func PulseChar(bright, dim string, frame int) string

func RenderBrailleChart

func RenderBrailleChart(title string, series []BrailleSeries, w, h int, yFmt func(float64) string) string

func RenderBudgetGauge

func RenderBudgetGauge(label string, used, limit float64, barW, labelW int, color lipgloss.Color, burnRate float64) string

func RenderDetailContent

func RenderDetailContent(snap core.QuotaSnapshot, w int, warnThresh, critThresh float64, activeTab int) string

func RenderFixedGrid

func RenderFixedGrid(rows []PanelRow, totalW, totalH int) string

func RenderGauge

func RenderGauge(percent float64, width int, warnThresh, critThresh float64) string

func RenderGradientGauge

func RenderGradientGauge(percent float64, width int, colors []lipgloss.Color) string

func RenderGradientText

func RenderGradientText(text string, frame int) string

func RenderHBarChart

func RenderHBarChart(items []chartItem, maxBarW, labelW int) string

func RenderInlineGauge

func RenderInlineGauge(pct float64, w int) string

func RenderMiniGauge

func RenderMiniGauge(usedPercent float64, width int) string

func RenderSparkline

func RenderSparkline(values []float64, w int, color lipgloss.Color) string

func RenderSubTabBar

func RenderSubTabBar(labels []string, active int, w int) string

func RenderTokenBreakdown

func RenderTokenBreakdown(input, output float64, w int) string

func RenderUsageGauge

func RenderUsageGauge(usedPercent float64, width int, warnThresh, critThresh float64) string

func SetThemeByName

func SetThemeByName(name string) bool

func StatusBadge

func StatusBadge(s core.Status) string

func StatusBorderColor

func StatusBorderColor(s core.Status) lipgloss.Color

func StatusColor

func StatusColor(s core.Status) lipgloss.Color

func StatusIcon

func StatusIcon(s core.Status) string

func StatusPill

func StatusPill(s core.Status) string

func ThemeName

func ThemeName() string

Types

type BrailleSeries

type BrailleSeries struct {
	Label  string
	Color  lipgloss.Color
	Points []core.TimePoint
}

type DetailTab

type DetailTab int
const (
	TabAll  DetailTab = 0 // show everything
	TabDyn1 DetailTab = 1 // first dynamic group
)

type Model

type Model struct {
	// contains filtered or unexported fields
}

func NewModel

func NewModel(
	warnThresh, critThresh float64,
	experimentalAnalytics bool,
	dashboardCfg config.DashboardConfig,
	accounts []core.AccountConfig,
) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) SetOnAddAccount added in v0.2.0

func (m *Model) SetOnAddAccount(fn func(core.AccountConfig))

SetOnAddAccount sets a callback invoked when a new provider account is added via the API Keys tab.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type Panel

type Panel struct {
	Title   string         // displayed in the top border
	Icon    string         // emoji icon before title
	Content string         // pre-rendered body text
	Span    int            // how many grid columns this panel occupies (1 or 2)
	Color   lipgloss.Color // accent color for the border
}

type PanelRow

type PanelRow struct {
	Panels []Panel
	Weight int // relative height weight (0 → 1)
}

type SnapshotsMsg

type SnapshotsMsg map[string]core.QuotaSnapshot

type Theme

type Theme struct {
	Name string
	Icon string // emoji identifier

	Base, Mantle                          lipgloss.Color
	Surface0, Surface1, Surface2, Overlay lipgloss.Color

	Text, Subtext, Dim lipgloss.Color

	Accent, Blue, Sapphire           lipgloss.Color
	Green, Yellow, Red               lipgloss.Color
	Peach, Teal, Flamingo            lipgloss.Color
	Rosewater, Lavender, Sky, Maroon lipgloss.Color
}

Jump to

Keyboard shortcuts

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