inputdialog

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package inputdialog provides a simple modal input dialog for capturing text input. Used for naming resources like snapshots and images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InputCancelMsg

type InputCancelMsg struct{}

InputCancelMsg is sent when user cancels the dialog

type InputConfirmMsg

type InputConfirmMsg struct {
	Value         string
	CheckboxValue bool // Value of optional checkbox if shown
}

InputConfirmMsg is sent when user confirms the input

type InputDialog

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

InputDialog represents a modal input dialog

func New

func New(title, prompt, placeholder string) *InputDialog

New creates a new input dialog

func (*InputDialog) HasTextInputFocused

func (d *InputDialog) HasTextInputFocused() bool

HasTextInputFocused returns true since this dialog always has text input focused

func (*InputDialog) Init

func (d *InputDialog) Init() tea.Cmd

Init initializes the dialog

func (*InputDialog) SetCheckbox

func (d *InputDialog) SetCheckbox(label string, defaultValue bool) *InputDialog

SetCheckbox adds an optional checkbox with the given label

func (*InputDialog) SetSize

func (d *InputDialog) SetSize(width, height int)

SetSize updates the dialog dimensions

func (*InputDialog) SetValidator

func (d *InputDialog) SetValidator(v forms.Validator) *InputDialog

SetValidator sets a custom validator for the input

func (*InputDialog) SetWarning

func (d *InputDialog) SetWarning(warning string) *InputDialog

SetWarning sets a warning message to display above the input

func (*InputDialog) Update

func (d *InputDialog) Update(msg tea.Msg) tea.Cmd

Update handles input for the dialog

func (*InputDialog) Value

func (d *InputDialog) Value() string

Value returns the current input value

func (*InputDialog) View

func (d *InputDialog) View() string

View renders the input dialog

Jump to

Keyboard shortcuts

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