prompt

package
v1.0.60 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChoiceCursor

func GetChoiceCursor(model tea.Model) (int, error)

func GetChoiceValue

func GetChoiceValue(model tea.Model) (string, error)

Types

type KeyMap

type KeyMap struct {
	Left  key.Binding
	Right key.Binding
}

func DefaultKeymap

func DefaultKeymap() KeyMap

type Model

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

func New

func New(message string, choices []string, opts ...Option) *Model

func (*Model) Left

func (m *Model) Left()

func (*Model) Right

func (m *Model) Right()

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

type Option

type Option = gn.Option[Model]

func WithActiveDialogButtonStyle

func WithActiveDialogButtonStyle(style lipgloss.Style) Option

func WithCursorPosition

func WithCursorPosition(cur int) Option

func WithDialogBoxStyle

func WithDialogBoxStyle(style lipgloss.Style) Option

func WithDialogButtonStyle

func WithDialogButtonStyle(style lipgloss.Style) Option

func WithQuestionPromptStyle

func WithQuestionPromptStyle(style lipgloss.Style) Option

type RooKeymap

type RooKeymap struct {
	Quit   key.Binding
	Select key.Binding
}

func DefaultRootKeymap

func DefaultRootKeymap() RooKeymap

type RootModel

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

func NewRoot

func NewRoot(ctx context.Context, message string, choices []string, opts ...Option) *RootModel

func (*RootModel) Err

func (r *RootModel) Err() error

func (*RootModel) Init

func (r *RootModel) Init() tea.Cmd

func (*RootModel) Update

func (r *RootModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*RootModel) View

func (r *RootModel) View() string

Jump to

Keyboard shortcuts

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