alert

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package alert demonstrates pkg/alert in the standard modal pattern, alongside the lighter app.Info / app.Error statusbar messages.

A list of mock operations: enter runs the highlighted one. Successful operations report through the statusbar (app.Info) and auto-clear on the next keypress. Failures pop a modal alert with an error-tinted border that the user must dismiss before continuing — the right shape for "stop and acknowledge" feedback.

The modal uses autosize (Options.Autosize = true): the pane word-wraps its message against 80% of the terminal width, grows vertically up to 60% of the terminal height, and scrolls internally when content overflows — see the "Merge upstream (long stderr)" op for the overflow case. The caller drops the outer layout.Center wrapper and composes with just layout.Sized(&s.modal) inside the ZStack.

The result message uses a typed alert.DismissedMsg via tea.Cmd, the parent matches in its own Update to dismiss the modal, exactly the same pattern as pkg/confirm.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t theme.Theme) screen.Screen

New returns the alert demo's root screen.

Types

This section is empty.

Jump to

Keyboard shortcuts

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