container

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

package container provides ui to display any model conforming to container.content inside a container. The container shows the content with a predefined border and a title.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content interface {
	Init() tea.Cmd
	Update(msg tea.Msg) (Content, tea.Cmd)
	UpdateFocus(isFocused bool) (Content, tea.Cmd)
	View() string
	Title() string
	SetSize(width, height int) Content
	KeyMap() help.KeyMap
}

Content is a interface that describes UI elements that can be displayed inside a container.

type Model

type Model struct {
	// contains filtered or unexported fields
}

func New

func New(content Content) Model

func (Model) Content

func (m Model) Content() Content

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) IsFocused

func (m Model) IsFocused() bool

func (Model) SetContent

func (m Model) SetContent(content Content) Model

func (Model) SetSize

func (m Model) SetSize(width, height int) Model

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) UpdateFocus

func (m Model) UpdateFocus(isFocused bool) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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