textinput

package
v0.0.0-...-766dd70 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	foam.Common

	*textinput.Model
}

Model wraps the Bubble Tea textinput model with additional functionality and styling options provided by the Sugarfoam framework.

func New

func New(opts ...Option) *Model

New creates a new text input model with optional configurations.

func (*Model) CanGrow

func (m *Model) CanGrow() bool

func (*Model) GetHeight

func (m *Model) GetHeight() int

func (*Model) Init

func (ti *Model) Init() tea.Cmd

Init initializes the text input model with a blink command.

func (*Model) Update

func (ti *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update updates the text input model based on the received message.

func (*Model) View

func (ti *Model) View() string

View renders the text input model, applying the appropriate style based on focus state.

type Option

type Option func(*Model)

Option is a type for functions that modify a text input model.

func WithPlaceholder

func WithPlaceholder(placeholder string) Option

WithPlaceholder sets the placeholder text for the text input.

func WithStyles

func WithStyles(styles *foam.Styles) Option

WithStyles sets the styles for the text input using the provided styles.

Jump to

Keyboard shortcuts

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