layout

package
v0.0.48 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyMapToSlice

func KeyMapToSlice(t any) (bindings []key.Binding)

func PlaceOverlay

func PlaceOverlay(
	x, y int,
	fg, bg string,
	shadow bool, opts ...WhitespaceOption,
) string

PlaceOverlay places fg on top of bg.

Types

type Bindings

type Bindings interface {
	BindingKeys() []key.Binding
}

type Container

type Container interface {
	tea.Model
	Sizeable
	Bindings
}

func NewContainer

func NewContainer(content tea.Model, options ...ContainerOption) Container

type ContainerOption

type ContainerOption func(*container)

func WithBorder

func WithBorder(top, right, bottom, left bool) ContainerOption

func WithBorderAll

func WithBorderAll() ContainerOption

func WithBorderHorizontal

func WithBorderHorizontal() ContainerOption

func WithBorderStyle

func WithBorderStyle(style lipgloss.Border) ContainerOption

func WithBorderVertical

func WithBorderVertical() ContainerOption

func WithDoubleBorder

func WithDoubleBorder() ContainerOption

func WithPadding

func WithPadding(top, right, bottom, left int) ContainerOption

Padding options

func WithPaddingAll

func WithPaddingAll(padding int) ContainerOption

func WithPaddingHorizontal

func WithPaddingHorizontal(padding int) ContainerOption

func WithPaddingVertical

func WithPaddingVertical(padding int) ContainerOption

func WithRoundedBorder

func WithRoundedBorder() ContainerOption

func WithThickBorder

func WithThickBorder() ContainerOption

type Focusable

type Focusable interface {
	Focus() tea.Cmd
	Blur() tea.Cmd
	IsFocused() bool
}

type Sizeable

type Sizeable interface {
	SetSize(width, height int) tea.Cmd
	GetSize() (int, int)
}

type SplitPaneLayout

type SplitPaneLayout interface {
	tea.Model
	Sizeable
	Bindings
	SetLeftPanel(panel Container) tea.Cmd
	SetRightPanel(panel Container) tea.Cmd
	SetBottomPanel(panel Container) tea.Cmd

	ClearLeftPanel() tea.Cmd
	ClearRightPanel() tea.Cmd
	ClearBottomPanel() tea.Cmd
}

func NewSplitPane

func NewSplitPane(options ...SplitPaneOption) SplitPaneLayout

type SplitPaneOption

type SplitPaneOption func(*splitPaneLayout)

func WithBottomPanel

func WithBottomPanel(panel Container) SplitPaneOption

func WithLeftPanel

func WithLeftPanel(panel Container) SplitPaneOption

func WithRatio

func WithRatio(ratio float64) SplitPaneOption

func WithRightPanel

func WithRightPanel(panel Container) SplitPaneOption

func WithVerticalRatio

func WithVerticalRatio(ratio float64) SplitPaneOption

type WhitespaceOption

type WhitespaceOption func(*whitespace)

WhitespaceOption sets a styling rule for rendering whitespace.

Jump to

Keyboard shortcuts

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