bubbleform

package module
v0.0.0-...-f10f9a5 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2025 License: MIT Imports: 3 Imported by: 0

README ΒΆ

Bubble Forms πŸ—οΈ

Under construction...

Bubble forms is a utility library for building and validating forms in bubbletea TUI applications.

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

This section is empty.

Functions ΒΆ

This section is empty.

Types ΒΆ

type Field ΒΆ

type Field interface {
	// Get the current value of the field
	Value() string

	// Set validation error on the field
	SetError(err error)

	// Optional method to reset field errors
	ClearError()
}

type Form ΒΆ

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

func NewForm ΒΆ

func NewForm(data interface{}) *Form

func (*Form) Bind ΒΆ

func (f *Form) Bind(key string, field Field) error

Bind a field to a specific struct field

func (*Form) GetErrors ΒΆ

func (f *Form) GetErrors() map[string]error

GetErrors returns all validation errors

func (*Form) Submit ΒΆ

func (f *Form) Submit() bool

Submit validates and populates the data struct

func (*Form) Validate ΒΆ

func (f *Form) Validate() bool

Validate all form fields and populate the data struct

Directories ΒΆ

Path Synopsis
examples
json command
overlay command
simple_form command

Jump to

Keyboard shortcuts

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