component

package
v0.0.1-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ButtonDefaultStyle = ButtonStyle{
		TextBase: lipgloss.NewStyle().
			Foreground(lipgloss.Color("15")).
			Padding(0, 1),
		TextFocus: lipgloss.NewStyle().
			Foreground(lipgloss.Color("15")).
			Bold(true).
			Background(lipgloss.Color("33")).
			Padding(0, 1),
		TextActive: lipgloss.NewStyle().
			Bold(true).
			Foreground(lipgloss.Color("33")).
			Padding(0, 1),
	}
)
View Source
var (
	OptionDefaultStyle = OptionStyle{
		TextBase: lipgloss.NewStyle().
			Foreground(lipgloss.Color("15")).
			MarginRight(1),
		TextFocus: lipgloss.NewStyle().
			Foreground(lipgloss.Color("15")).
			Bold(true).
			Background(lipgloss.Color("33")).
			MarginRight(1),
		TextActive: lipgloss.NewStyle().
			Foreground(lipgloss.Color("33")).
			Bold(true).
			MarginRight(1),
		CursorBase: lipgloss.NewStyle().
			Foreground(lipgloss.Color("15")).
			PaddingRight(1),
		CursorFocus: lipgloss.NewStyle().
			Foreground(lipgloss.Color("15")).
			Bold(true).
			Background(lipgloss.Color("33")).
			PaddingRight(1),
		CursorActive: lipgloss.NewStyle().
			Foreground(lipgloss.Color("33")).
			Bold(true).
			PaddingRight(1),
	}
)
View Source
var (
	TextDefaultStyle = TextStyle{
		TextBase: lipgloss.NewStyle().
			Foreground(lipgloss.Color("15")),
	}
)

Functions

This section is empty.

Types

type ActiveMsg

type ActiveMsg struct {
	Active bool
}

type Button

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

func NewButton

func NewButton(label string) *Button

func (*Button) Init

func (m *Button) Init() tea.Cmd

func (*Button) SetLabel

func (m *Button) SetLabel(label string) *Button

func (*Button) SetTextActiveStyle

func (m *Button) SetTextActiveStyle(style lipgloss.Style) *Button

func (*Button) SetTextBaseStyle

func (m *Button) SetTextBaseStyle(style lipgloss.Style) *Button

func (*Button) SetTextFocusStyle

func (m *Button) SetTextFocusStyle(style lipgloss.Style) *Button

func (*Button) Update

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

func (*Button) View

func (m *Button) View() string

type ButtonState

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

type ButtonStyle

type ButtonStyle struct {
	TextBase   lipgloss.Style
	TextFocus  lipgloss.Style
	TextActive lipgloss.Style
}

type Component

type Component = tea.Model

type FocusMsg

type FocusMsg struct {
	Focus bool
}

type Option

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

func NewOption

func NewOption(label string) *Option

func (*Option) Init

func (m *Option) Init() tea.Cmd

func (*Option) SetCursor

func (m *Option) SetCursor(cursor string) *Option

func (*Option) SetCursorActiveStyle

func (m *Option) SetCursorActiveStyle(style lipgloss.Style) *Option

func (*Option) SetCursorBaseStyle

func (m *Option) SetCursorBaseStyle(style lipgloss.Style) *Option

func (*Option) SetCursorFocusStyle

func (m *Option) SetCursorFocusStyle(style lipgloss.Style) *Option

func (*Option) SetLabel

func (m *Option) SetLabel(label string) *Option

func (*Option) SetTextActiveStyle

func (m *Option) SetTextActiveStyle(style lipgloss.Style) *Option

func (*Option) SetTextBaseStyle

func (m *Option) SetTextBaseStyle(style lipgloss.Style) *Option

func (*Option) SetTextFocusStyle

func (m *Option) SetTextFocusStyle(style lipgloss.Style) *Option

func (*Option) Update

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

func (*Option) View

func (m *Option) View() string

type OptionProps

type OptionProps struct {
	Label string
}

type OptionState

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

type OptionStyle

type OptionStyle struct {
	TextBase     lipgloss.Style
	TextFocus    lipgloss.Style
	TextActive   lipgloss.Style
	CursorBase   lipgloss.Style
	CursorFocus  lipgloss.Style
	CursorActive lipgloss.Style
}

type Text

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

func NewText

func NewText(label string) *Text

func (*Text) Init

func (m *Text) Init() tea.Cmd

func (*Text) SetContent

func (m *Text) SetContent(content string) *Text

func (*Text) SetTextBaseStyle

func (m *Text) SetTextBaseStyle(style lipgloss.Style) *Text

func (*Text) Update

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

func (*Text) View

func (m *Text) View() string

type TextStyle

type TextStyle struct {
	TextBase lipgloss.Style
}

type WithChild

type WithChild interface {
	Child() Component
}

Jump to

Keyboard shortcuts

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