modal

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopMode

func PopMode() tea.Msg

PopMode pops the top-level mode from the modal stack. If there's no modes on the stack, this method does nothing.

func PushMode

func PushMode(newMode tea.Model) tea.Cmd

PushMode pushes a new mode on the modal stack. The new mode will receive keyboard events.

Types

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

Modal is a tea model which displays modes on a stack. Only the top-level model is display and will receive keyboard and mouse events.

func New

func New(baseMode tea.Model) Modal

func (Modal) Init

func (m Modal) Init() tea.Cmd

func (Modal) Len

func (m Modal) Len() int

Len returns the number of models on the mode stack

func (*Modal) Pop

func (m *Modal) Pop() (p tea.Model)

Pop pops a model from the stack

func (*Modal) Push

func (m *Modal) Push(model tea.Model)

Push pushes a new model onto the modal stack

func (Modal) Resize

func (m Modal) Resize(w, h int) layout.ResizingModel

func (Modal) Update

func (m Modal) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Modal) View

func (m Modal) View() string

Jump to

Keyboard shortcuts

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