layout

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 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

WithBorder allows you to set borders for each side of the container. You can specify different values for top, right, bottom, and left borders.

func WithBorderAll

func WithBorderAll() ContainerOption

WithBorderAll sets borders on all sides of the container.

func WithBorderHorizontal

func WithBorderHorizontal() ContainerOption

WithBorderHorizontal sets borders on the left and right sides of the container.

func WithBorderStyle

func WithBorderStyle(style lipgloss.Border) ContainerOption

WithBorderStyle sets the style of the border.

func WithBorderVertical

func WithBorderVertical() ContainerOption

WithBorderVertical sets borders on the top and bottom sides of the container.

func WithDoubleBorder

func WithDoubleBorder() ContainerOption

WithDoubleBorder sets the style of the border to DoubleBorder.

func WithPadding

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

WithPadding allows you to set padding for each side of the container. You can specify different values for top, right, bottom, and left padding.

func WithPaddingAll

func WithPaddingAll(padding int) ContainerOption

WithPaddingAll sets the same padding value for all sides of the container.

func WithPaddingHorizontal

func WithPaddingHorizontal(padding int) ContainerOption

WithPaddingHorizontal sets the same padding value for the left and right sides of the container.

func WithPaddingVertical

func WithPaddingVertical(padding int) ContainerOption

WithPaddingVertical sets the same padding value for the top and bottom sides of the container.

func WithRoundedBorder

func WithRoundedBorder() ContainerOption

WithRoundedBorder sets the style of the border to RoundedBorder.

func WithThickBorder

func WithThickBorder() ContainerOption

WithThickBorder sets the style of the border to ThickBorder.

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