tui

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewModel

func NewModel(cfg Config) model

func Run

func Run(cfg Config) error

Run starts the TUI program with the given configuration.

Types

type Config

type Config struct {
	ImageRef string
	Resolver image.Resolver
	NoCache  bool
	// Platform is the canonical "os/arch[/variant]" string the user passed
	// via --platform, or "" when no pin was set. Display-only: shown in the
	// header so the operator knows which variant of a multi-platform image
	// is on screen. Resolver behaviour is governed by image.WithPlatform,
	// not this field.
	Platform string
	// Theme is the name of the colour theme to use. Empty string means the
	// built-in default (tokyo-night). Valid values match the names accepted
	// by the theme: key in .layerx.yaml.
	Theme string
	// TransparentBg strips all background colours from the TUI so the
	// terminal's own background shows through. Opt-in; default false.
	TransparentBg bool
}

type Theme added in v1.6.0

type Theme struct {
	// Accent / brand
	Accent color.Color

	// Panel borders
	FocusedBorder   color.Color
	UnfocusedBorder color.Color

	// Selection
	Selected   color.Color
	SelectedBg color.Color

	// Diff
	Added     color.Color
	Modified  color.Color
	Removed   color.Color
	Unchanged color.Color

	// Chrome (status bar, header)
	Separator color.Color
	Command   color.Color
	StatusKey color.Color
	StatusDim color.Color
	StatusBg  color.Color
	HeaderDim color.Color
	HeaderSep color.Color
	FileName  color.Color

	// Dim / tree
	MetaDim   color.Color
	TreeDim   color.Color
	ScrollDim color.Color

	// Search
	SearchHighlightBg color.Color
	SearchCurrentBg   color.Color
	SearchCurrentFg   color.Color

	// Overall terminal background (set via tea.WithBackgroundColor).
	// Gives the whole UI a consistent base so header/footer bars feel
	// grounded rather than floating on pure black.
	MainBg color.Color

	// Chroma syntax highlight theme name (passed to chroma styles.Get)
	ChromaStyle string

	// GradientStart and GradientEnd define the colour sweep applied to the
	// image ref in the header bar. Blue→purple is the default direction;
	// each theme tunes the exact stops to complement its palette.
	GradientStart color.Color
	GradientEnd   color.Color
}

Theme holds all colors used by the TUI. Add a constructor function per named theme; NewModel picks which one to use.

func CatppuccinMocha added in v1.6.0

func CatppuccinMocha() Theme

CatppuccinMocha is the original built-in theme.

func Cyberdream added in v1.6.0

func Cyberdream() Theme

Cyberdream is a high-contrast neon synthwave theme — near-black base with electric cyan, magenta, and lime accents.

func Dracula added in v1.6.0

func Dracula() Theme

Dracula is a high-contrast purple/pink theme with vibrant cyan and green accents on a near-black background.

func GruvboxDark added in v1.6.0

func GruvboxDark() Theme

GruvboxDark is a retro earthy theme with warm amber, orange, and green accents on a dark brown base.

func Kanagawa added in v1.6.0

func Kanagawa() Theme

Kanagawa is a warm dark theme inspired by the colours of Katsushika Hokusai's "The Great Wave" — deep indigo base with gold, sakura, and jade accents.

func Oxocarbon added in v1.6.0

func Oxocarbon() Theme

Oxocarbon is an IBM Carbon-inspired theme — cool charcoal base with cyan, teal, and lilac accents.

func RosePine added in v1.6.0

func RosePine() Theme

RosePine is a soft, muted dark theme with dusty rose, mauve, and pine green on a deep midnight base.

func TokyoNight added in v1.6.0

func TokyoNight() Theme

Jump to

Keyboard shortcuts

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