ui

package
v0.0.0-...-4fcd703 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func New

func New() *App

func (*App) Init

func (a *App) Init() tea.Cmd

func (*App) Update

func (a *App) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*App) View

func (a *App) View() tea.View

type Field

type Field struct {
	Label       string
	Multiline   bool
	Placeholder string
	Value       string
}

Field is one input of a form tool.

type Form

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

Form is the generic Tool used by every tool except the stopwatch.

func NewForm

func NewForm(s Spec) *Form

func (*Form) Desc

func (f *Form) Desc() string

func (*Form) Focus

func (f *Form) Focus() tea.Cmd

func (*Form) Icon

func (f *Form) Icon() string

func (*Form) SetSize

func (f *Form) SetSize(w, h int)

func (*Form) Title

func (f *Form) Title() string

func (*Form) Update

func (f *Form) Update(msg tea.Msg) tea.Cmd

func (*Form) View

func (f *Form) View() string

type Option

type Option struct {
	Label  string
	Values []string
}

Option is a cycling choice shown as a chip row above the inputs.

type Spec

type Spec struct {
	Title, Desc string
	Icon        string
	Fields      []Field
	Options     []Option
	Run         func(in []string, opt []int) (tools.Result, error)
}

Spec describes a form tool: inputs + options in, text out, recomputed live.

type Stopwatch

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

Stopwatch measures from the wall clock, so it keeps counting while you use other tools.

func NewStopwatch

func NewStopwatch() *Stopwatch

func (*Stopwatch) Desc

func (s *Stopwatch) Desc() string

func (*Stopwatch) Focus

func (s *Stopwatch) Focus() tea.Cmd

func (*Stopwatch) Icon

func (s *Stopwatch) Icon() string

func (*Stopwatch) SetSize

func (s *Stopwatch) SetSize(w, h int)

func (*Stopwatch) Title

func (s *Stopwatch) Title() string

func (*Stopwatch) Update

func (s *Stopwatch) Update(msg tea.Msg) tea.Cmd

func (*Stopwatch) View

func (s *Stopwatch) View() string

type Tool

type Tool interface {
	Title() string
	Icon() string
	Desc() string
	// Focus is called every time the tool is opened.
	Focus() tea.Cmd
	Update(tea.Msg) tea.Cmd
	View() string
	SetSize(w, h int)
}

Tool is one screen in the app. Implementations are pointers and keep their state between visits.

Jump to

Keyboard shortcuts

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