confirm

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package confirm provides a simple confirmation dialog component

Index

Constants

This section is empty.

Variables

View Source
var (
	InactiveButtonStyle = lipgloss.NewStyle().
		Foreground(colors.InactiveButtonFg).
		Background(colors.InactiveButtonBg).
		Padding(buttonPadding...).
		Margin(buttonMargin...)
)
View Source
var Keys = KeyMap{
	Toggle: key.NewBinding(
		key.WithKeys("tab", "h", "l", "left", "right"),
		key.WithHelp("", "toggle"),
	),
	Confirm: key.NewBinding(
		key.WithKeys("y"),
		key.WithHelp("y", "confirm"),
	),
	Cancel: key.NewBinding(
		key.WithKeys("n"),
		key.WithHelp("n", "cancel"),
	),
	Submit: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "submit"),
	),
	Quit: key.NewBinding(
		key.WithKeys("ctrl+c", "q"),
		key.WithHelp("q", "quit"),
	),
}

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	Toggle  key.Binding
	Confirm key.Binding
	Cancel  key.Binding
	Submit  key.Binding
	Quit    key.Binding
}

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

type Model

type Model struct {
	Prompt    string
	Confirmed bool
	Submitted bool
	// contains filtered or unexported fields
}

func New

func New(prompt string) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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