A Bubble Tea component for creating multi-pane applications.
Use ctrl+h, ctrl+j, ctrl+k and ctrl+l to switch between panes, with only the active pane being updated.
To describe a pane layout, use a 2D slice of Models like so:
p := panes.New(
[][]tea.Model{
{yourmodel.New(), yourmodel.New()},
{yourmodel.New(), yourmodel.New()},
},
)To execute a function when focus enters and leaves a pane, implement In and Out methods on your model like so:
func (m Model) In() tea.Model {
m.Focus()
return m
}
func (m Model) Out() tea.Model {
m.Blur()
return m
}