Skip to content

A Bubble Tea component for creating multi-pane applications

Notifications You must be signed in to change notification settings

john-marinelli/panes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Panes

A Bubble Tea component for creating multi-pane applications.

example

Default Keybinds

Use ctrl+h, ctrl+j, ctrl+k and ctrl+l to switch between panes, with only the active pane being updated.

Describe your pane layout

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()},
        },
    )

Transitions

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
    }

About

A Bubble Tea component for creating multi-pane applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages