Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( OK = Type(MB_OK) OK_CANCEL = Type(MB_OK | MB_CANCEL) YES_NO = Type(MB_YES | MB_NO) YES_NO_ALL = Type(MB_YES | MB_NO | MB_ALL) )
Available message box types
Functions ¶
func PlaceOverlay ¶
func PlaceOverlay(x, y int, fg, bg string, opts ...WhitespaceOption) string
PlaceOverlay places fg on top of bg.
func WithPosition ¶
func WithPosition(x, y int) optionFunc
WithPosition sets the position of the top left of the messagebox in columns from the left (x), and rows from the top (y).
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the bubbletea model for message box.
func (Model) New ¶
New creates a new modal message box with the given options. You would normally do this in the parent control's Update method in response to a key message.
While the message box in in an active state, you should direct all UI messages to its update method.
func (Model) Render ¶
Render takes in the main view content and overlays the model's active message box. This function expects you to build the entirety of your view's content before calling this function. It's recommended for this to be the final call of your model's View(). Returns a string representation of the content with overlayed message box.
type WhitespaceOption ¶
type WhitespaceOption func(*whitespace)
WhitespaceOption sets a styling rule for rendering whitespace.