tui

package
v0.0.0-...-f5eb585 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewViewportProgram

func NewViewportProgram(initialModel Model) *tea.Program

func UpdateViewport

func UpdateViewport(content string, width int) tea.Msg

func UpdateViewportLine

func UpdateViewportLine(lineNum int, line string) tea.Msg

Types

type Model

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

func NewModel

func NewModel(title string) Model

func (Model) Init

func (m Model) Init() tea.Cmd

default init, does nothing

func (Model) Update

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

update handles key presses and readying the viewport

func (Model) View

func (m Model) View() string

The main view renders the header, viewport and footer

func (Model) WithMinWidth

func (m Model) WithMinWidth(minWidth int) Model

func (Model) WithViewport

func (m Model) WithViewport(lines []string) Model

Jump to

Keyboard shortcuts

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