dialog

package
v0.0.0-...-839ffb1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Message string
	Options []Option
}

type Option

type Option struct {
	Keybind key.Binding
	Text    string
	Value   uint
}
type Popup struct {
	// contains filtered or unexported fields
}

func NewPopup

func NewPopup(config Config) *Popup

NewPopup returns a new screen based on the given Config. This screen needs to be used with orvyn.OpenDialog().

func (*Popup) OnEnter

func (s *Popup) OnEnter(i any) tea.Cmd

func (*Popup) OnExit

func (s *Popup) OnExit() any

func (*Popup) Render

func (s *Popup) Render() orvyn.Layout

func (*Popup) Update

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

type Progress

type Progress struct {

	// Interrupted flag will hold true if the progress was interrupted by the user.
	Interrupted bool
	// contains filtered or unexported fields
}

Progress is a dialog for quick implementation of a progress dialog.

func NewProgress

func NewProgress(title string) *Progress

NewProgress returns a new screen that represents a progress dialog. This screen needs to be used with orvyn.OpenDialog().

func (*Progress) OnEnter

func (p *Progress) OnEnter(i any) tea.Cmd

func (*Progress) OnExit

func (p *Progress) OnExit() any

func (*Progress) Render

func (p *Progress) Render() orvyn.Layout

func (*Progress) Reset

func (p *Progress) Reset()

Reset helps resetting the dialog to it's default state.

func (*Progress) SetBarColor

func (p *Progress) SetBarColor(color lipgloss.Color)

SetBarColor helps changing the underlying progressBar color.

func (*Progress) SetCancelKeybind

func (p *Progress) SetCancelKeybind(key *key.Binding)

SetCancelKeybind helps defining or removing a cancel keybind. The given keybind must have the Help initialized. For example :

keybind := key.NewBinding(key.WithKeys("esc"), key.WithHelp("esc", "cancel")) p.dial.SetCancelKeybind(&keybind)

func (*Progress) Update

func (p *Progress) Update(msg tea.Msg) tea.Cmd

func (*Progress) UpdateProgress

func (p *Progress) UpdateProgress(steps, maxSteps int)

UpdateProgress should be used to update the underlying progressBar.

Jump to

Keyboard shortcuts

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