prompt

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package prompt is a small modal text field used to collect a single- or multi-line value (an issue title, a comment, a label list). It is a dumb component: the parent decides which keys submit or cancel and reads Value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

func New

func New() Model

func (Model) Multiline

func (m Model) Multiline() bool

Multiline reports whether the open prompt is a multi-line field.

func (*Model) Open

func (m *Model) Open(title, placeholder string, multiline bool) tea.Cmd

Open configures the prompt for a field and focuses it, returning the focus command so the caller can start the cursor. multiline chooses a textarea (submit on ctrl+d) over a single-line input (submit on enter).

func (*Model) SetWidth

func (m *Model) SetWidth(w int)

SetWidth sizes the modal and its field.

func (*Model) Update

func (m *Model) Update(msg tea.Msg) tea.Cmd

Update forwards a message (key, cursor blink) to the focused field.

func (Model) Value

func (m Model) Value() string

Value returns the current field contents.

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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