Documentation
¶
Overview ¶
Package alert provides a modal alert/confirm component for bubbletea TUIs.
Use New for an informational modal with a single OK button, and NewConfirm for a Yes/No prompt that runs a tea.Cmd on confirmation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind int
Kind discriminates the alert flavour. Each kind changes the accent colour and the available actions.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is a centred modal that overlays a parent TUI.
confirmYes is only meaningful when Kind == KindConfirm. confirmCmd is the tea.Cmd dispatched when the user confirms (Yes / Enter while Yes is highlighted / y).
func NewConfirm ¶
NewConfirm builds a Yes/No modal that runs confirmCmd when the user picks Yes. Yes is the default focus.
func (Model) Resize ¶
Resize updates the centre region the modal is rendered against. Call on tea.WindowSizeMsg if the parent forwards resizes.