ui

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ui — components.go provides reusable rendering helpers for panels.

Package ui — dashboard.go renders the K9s-inspired dashboard view.

Package ui — detail_views.go renders K9s-style full-screen detail views.

Package ui provides styling constants and helpers using Lipgloss. Uses a K9s-inspired dark theme with cyan/blue accents.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Core accent — K9s signature cyan/teal
	ColorAccent    = lipgloss.Color("#00d7d7")
	ColorAccentDim = lipgloss.Color("#008b8b")

	// Logo gradient
	ColorLogo1 = lipgloss.Color("#5fafff")
	ColorLogo2 = lipgloss.Color("#00d7d7")

	// Semantic
	ColorSuccess = lipgloss.Color("#00d787")
	ColorWarning = lipgloss.Color("#d7af00")
	ColorDanger  = lipgloss.Color("#ff5f5f")

	// Neutrals
	ColorWhite     = lipgloss.Color("#e4e4e4")
	ColorFg        = lipgloss.Color("#bcbcbc")
	ColorDim       = lipgloss.Color("#6c6c6c")
	ColorSubtle    = lipgloss.Color("#444444")
	ColorBorder    = lipgloss.Color("#3a3a3a")
	ColorBg        = lipgloss.Color("#1c1c1c")
	ColorHeaderBg  = lipgloss.Color("#262626")
	ColorSelected  = lipgloss.Color("#303030")
	ColorCrumbBg   = lipgloss.Color("#303030")
	ColorStatusBar = lipgloss.Color("#1c1c1c")

	// Backward compat aliases
	ColorPrimary   = ColorAccent
	ColorSecondary = ColorDim
	ColorMuted     = ColorSubtle
)
View Source
var CrumbSepStyle = lipgloss.NewStyle().
	Foreground(ColorDim)

CrumbSepStyle for the separator between crumbs.

View Source
var CrumbStyle = lipgloss.NewStyle().
	Background(ColorCrumbBg).
	Foreground(ColorAccent).
	Bold(true).
	Padding(0, 1)

CrumbStyle renders breadcrumb segments.

View Source
var HeaderBarStyle = lipgloss.NewStyle().
	Background(ColorHeaderBg).
	Foreground(ColorFg).
	Padding(0, 1)

HeaderBarStyle is the full-width top bar background.

View Source
var HelpStyle = lipgloss.NewStyle().
	Foreground(ColorDim)

HelpStyle for the command bar at the bottom.

View Source
var InfoStyle = lipgloss.NewStyle().
	Foreground(ColorDim)

InfoStyle for inline key:value stats on the header line.

View Source
var InfoValueStyle = lipgloss.NewStyle().
	Foreground(ColorFg)

InfoValueStyle for stat values in the header.

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

KeyStyle for a keyboard shortcut key.

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

LabelStyle for field labels inside panels.

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

LogoStyle renders the "devdash" logo text.

View Source
var PanelStyle = SectionBorder

PanelStyle = SectionBorder (alias for backward compat)

View Source
var SectionBorder = lipgloss.NewStyle().
	Border(lipgloss.NormalBorder()).
	BorderForeground(ColorBorder).
	Padding(0, 1)

SectionBorder uses a thin line box.

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

SectionTitleStyle renders a panel header label.

View Source
var SepStyle = lipgloss.NewStyle().
	Foreground(ColorBorder)

SepStyle for horizontal rule lines.

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

StatusFail styles fail/error values.

View Source
var StatusIdle = lipgloss.NewStyle().
	Foreground(ColorSubtle).
	Italic(true)

StatusIdle styles idle/placeholder values.

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

StatusPass styles pass/ok values.

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

StatusWarn styles warning values.

View Source
var SubtitleStyle = lipgloss.NewStyle().
	Foreground(ColorDim).
	MarginBottom(0)

SubtitleStyle for secondary information.

View Source
var TableHeaderStyle = lipgloss.NewStyle().
	Bold(true).
	Foreground(ColorAccentDim).
	BorderBottom(true).
	BorderStyle(lipgloss.NormalBorder()).
	BorderForeground(ColorBorder)

TableHeaderStyle for column headers inside panels.

View Source
var TableRowAltStyle = lipgloss.NewStyle().
	Foreground(ColorFg).
	Background(ColorSelected)

TableRowAltStyle for alternating rows (subtle highlight).

View Source
var TableRowStyle = lipgloss.NewStyle().
	Foreground(ColorFg)

TableRowStyle for regular data rows.

View Source
var TitleStyle = lipgloss.NewStyle().
	Bold(true).
	Foreground(ColorBg).
	Background(ColorAccent).
	Padding(0, 2)

TitleStyle (alias — used by detail_views)

View Source
var ValueStyle = lipgloss.NewStyle().
	Foreground(ColorWhite)

ValueStyle for field values.

Functions

func RenderBenchDetail

func RenderBenchDetail(ds *state.Dashboard, width, height int) string

RenderBenchDetail renders a full-screen view of benchmark results.

func RenderCommandBar

func RenderCommandBar(bindings []KeyBinding, width int) string

RenderCommandBar renders a full-width bottom bar with key hints.

func RenderCrumbs

func RenderCrumbs(items ...string) string

RenderCrumbs renders K9s-style breadcrumb navigation.

func RenderDashboard

func RenderDashboard(ds *state.Dashboard, width, height int) string

RenderDashboard composes the K9s-style terminal dashboard.

func RenderDepsDetail

func RenderDepsDetail(ds *state.Dashboard, width, height int) string

RenderDepsDetail renders a full-screen view of module dependencies.

func RenderField

func RenderField(label, value string) string

RenderField formats a label: value line.

func RenderGitDetail

func RenderGitDetail(ds *state.Dashboard, width, height int) string

RenderGitDetail renders a full-screen view of git status.

func RenderHelp

func RenderHelp(bindings []KeyBinding) string

RenderHelp builds the K9s-style command bar.

func RenderLintDetail

func RenderLintDetail(ds *state.Dashboard, width, height int) string

RenderLintDetail renders a full-screen view of lint results.

func RenderLogo() string

RenderLogo returns the styled ASCII logo.

func RenderPanel

func RenderPanel(title, body string, width int) string

RenderPanel is kept for backward compat. Delegates to RenderSection.

func RenderSection

func RenderSection(title, body string, width int) string

RenderSection renders a K9s-style bordered section with a title label.

func RenderStatusField

func RenderStatusField(label, value string, style lipgloss.Style) string

RenderStatusField renders a label with a colored status value.

func RenderTableHeader

func RenderTableHeader(cols []TableColumn) string

RenderTableHeader renders column headers with a separator line below.

func RenderTableRow

func RenderTableRow(values []string, cols []TableColumn, alt bool) string

RenderTableRow renders a single data row, optionally with alt-row bg.

func RenderTestsDetail

func RenderTestsDetail(ds *state.Dashboard, width, height int) string

RenderTestsDetail renders a full-screen view of test results.

func StatChip

func StatChip(label, value string) string

StatChip renders a "label:value" pair for the header stats bar.

func StatusDot

func StatusDot(label string, style lipgloss.Style) string

StatusDot returns a colored bullet indicator: ● ● ● ○

Types

type KeyBinding

type KeyBinding struct {
	Key  string
	Desc string
}

KeyBinding maps a key to its description.

type TableColumn

type TableColumn struct {
	Header string
	Width  int
}

TableColumn describes a column in a simple text table.

Jump to

Keyboard shortcuts

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