alerts

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package alerts handles showing alerts over the ui with auto-disappear functionality

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddAlertMsg

type AddAlertMsg struct {
	Msg Alert
}

type Alert

type Alert struct {
	Type    AlertType
	Title   string
	Message string
	Visible bool
	// contains filtered or unexported fields
}

Alert hold data, that will appear later on ui

type AlertModel

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

func New

func New(t theme.Theme) AlertModel

func (AlertModel) AlertStates

func (m AlertModel) AlertStates(
	totalWidth int,
	totalHeight int,
) []AlertState

AlertViews render each alert, then return all strings to be placed properly

func (AlertModel) Update

func (m AlertModel) Update(msg tea.Msg) (AlertModel, tea.Cmd)

type AlertState

type AlertState struct {
	AlertView string
	X         int
	Y         int
	IsVisible bool
}

type AlertType

type AlertType string

AlertType each type will be render differently on ui

var (
	AlertTypeInfo    AlertType = "info"
	AlertTypeWarning AlertType = "warning"
	MsgTypeError     AlertType = "error"
)

type TickMsg

type TickMsg struct{}

Jump to

Keyboard shortcuts

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