textinput

package
v0.0.0-...-8415d4e Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMask = '●'
View Source
const DefaultTemplate = `
{{- .Prompt }}
> {{ .Input -}}
`

Variables

This section is empty.

Functions

func NewModel

func NewModel(text *TextInput) *model

Types

type TextInput

type TextInput struct {
	Prompt string

	Placeholder  string
	InitialValue string

	Validate     func(string) error
	AutoComplete func(string) []string

	Hidden                bool
	HideMask              rune
	CharLimit             int
	InputWidth            int
	Template              string
	ResultTemplate        string
	ExtendedTemplateFuncs template.FuncMap

	// Styles of the actual input field. These will be applied as inline styles.
	//
	// For an introduction to styling with Lip Gloss see:
	// https://github.com/charmbracelet/lipgloss
	InputTextStyle        lipgloss.Style
	InputBackgroundStyle  lipgloss.Style // Deprecated: This property is not used anymore.
	InputPlaceholderStyle lipgloss.Style
	InputCursorStyle      lipgloss.Style

	WrapMode     promptkit.WrapMode
	Output       io.Writer
	Input        io.Reader
	ColorProfile termenv.Profile
}

func New

func New(prompt string) *TextInput

func (*TextInput) RunPrompt

func (t *TextInput) RunPrompt() (string, error)

Jump to

Keyboard shortcuts

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