Documentation
¶
Overview ¶
Package prompt provides a multi-button confirm overlay for the tui/app shell — for questions where a plain yes/no is not enough (e.g. "stop containers / quit and keep running / cancel").
The overlay closes itself and emits a ResultMsg; the hosting Content handles the outcome:
case prompt.ResultMsg:
switch msg.Choice { case "stop": ...; case "quit": ... }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Choice ¶
type Choice struct {
// ID is returned in ResultMsg.Choice (e.g. "stop", "quit", "cancel").
ID string
// Label is the button text.
Label string
}
Choice is one button of a prompt.
type Options ¶
type Options struct {
// ID names the overlay and is echoed in ResultMsg (default "confirm").
ID string
Title string
Message string
// Choices default to Yes ("yes") / No ("no").
Choices []Choice
// Default is the initially selected choice index.
Default int
// Danger styles the title with the error color.
Danger bool
// MaxWidth bounds the modal (default 70).
MaxWidth int
}
Options configure New.
Click to show internal directories.
Click to hide internal directories.