tui

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DrPurple      = lipgloss.Color("#7770F9") // purple-60
	DrPurpleLight = lipgloss.Color("#B4B0FF") // purple-40
	DrIndigo      = lipgloss.Color("#5C41FF") // indigo-70
	DrRed         = lipgloss.Color("#9A3131") // red-80
	DrGreen       = lipgloss.Color("#81FBA5") // green-60
	DrYellow      = lipgloss.Color("#F6EB61") // yellow-60
	DrBlack       = lipgloss.Color("#0B0B0B") // black-90
)

DataRobot brand colors, utilizing the Design System palette

View Source

Banner contains the DataRobot ASCII art logo

Variables

View Source
var (
	BaseTextStyle = lipgloss.NewStyle().Foreground(DrPurple)
	ErrorStyle    = lipgloss.NewStyle().Foreground(DrRed).Bold(true)

	// Specific UI styles
	LogoStyle     = BaseTextStyle
	WelcomeStyle  = BaseTextStyle.Bold(true)
	SubTitleStyle = BaseTextStyle.Bold(true).
					Foreground(DrPurpleLight).
					BorderBottom(true).
					BorderStyle(lipgloss.NormalBorder()).
					BorderForeground(DrGreen)
	BoxStyle = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(DrPurple).
				Padding(1, 2)
	StatusBarStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(DrPurpleLight).
					Foreground(DrPurpleLight).
					Padding(0, 1)
)

Common style definitions using DataRobot branding

Functions

func Footer() string

Footer renders the common footer with quit instructions

func Header() string

Types

type InterruptibleModel added in v0.1.5

type InterruptibleModel struct {
	Model tea.Model
}

InterruptibleModel wraps any Bubble Tea model to ensure Ctrl-C always works. This wrapper intercepts ALL messages before they reach the underlying model, checking for Ctrl-C and immediately quitting if detected. This guarantees users can never get stuck in the program, regardless of what the model does.

func NewInterruptibleModel added in v0.1.5

func NewInterruptibleModel(model tea.Model) InterruptibleModel

NewInterruptibleModel wraps a model to ensure Ctrl-C always works everywhere. Use this when creating any Bubble Tea program to guarantee users can exit.

Example:

m := myModel{}
p := tea.NewProgram(tui.NewInterruptibleModel(m), tea.WithAltScreen())

func (InterruptibleModel) Init added in v0.1.5

func (m InterruptibleModel) Init() tea.Cmd

func (InterruptibleModel) Update added in v0.1.5

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

func (InterruptibleModel) View added in v0.1.5

func (m InterruptibleModel) View() string

Jump to

Keyboard shortcuts

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