Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application represents the main TUI application.
func NewApplication ¶
func NewApplication() *Application
NewApplication creates a new TUI application.
func (*Application) AddComponent ¶
func (a *Application) AddComponent(c Component)
AddComponent adds a component to the application.
func (*Application) FocusComponent ¶
func (a *Application) FocusComponent(index int)
FocusComponent focuses a specific component by index, blurring the currently focused one.
type Component ¶
type Component interface {
// Init initializes the component.
Init() tea.Cmd
// Update handles messages and updates component state.
Update(msg tea.Msg) (Component, tea.Cmd)
// View renders the component.
View() string
// Focus is called when this component receives focus.
Focus()
// Blur is called when this component loses focus.
Blur()
// Focused returns whether this component is currently focused.
Focused() bool
}
Component is the interface all TUI components must implement.
Click to show internal directories.
Click to hide internal directories.