MCPcopy
hub / github.com/charmbracelet/huh / Input

Struct Input

field_input.go:23–46  ·  view source on GitHub ↗

Input is a input field. The input field is a field that allows the user to enter text. Use it to user input. It can be used for collecting text, passwords, or other short input. The input field supports Suggestions, Placeholder, and Validation.

Source from the content-addressed store, hash-verified

21//
22// The input field supports Suggestions, Placeholder, and Validation.
23type Input struct {
24 accessor Accessor[string]
25 key string
26 id int
27
28 title Eval[string]
29 description Eval[string]
30 placeholder Eval[string]
31 suggestions Eval[[]string]
32
33 textinput textinput.Model
34
35 inline bool
36 validate func(string) error
37 err error
38 focused bool
39
40 width int
41 height int
42
43 theme Theme
44 hasDarkBg bool
45 keymap InputKeyMap
46}
47
48// NewInput creates a new input field.
49//

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected