viewport

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	Esc   key.Binding
	Enter key.Binding
	Slash key.Binding
	// contains filtered or unexported fields
}

func DefaultKeyMap

func DefaultKeyMap() KeyMap

type Model

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

Model wraps the viewport.Model type.

It adds the following functionality:

  • A text input for filtering the content
  • Focus/blur functionality
  • Loading spinner
  • Empty state message

func New

func New(width, height int) Model

New creates a new Model with the given width and height.

func (*Model) Blur

func (m *Model) Blur()

func (*Model) Focus

func (m *Model) Focus()

func (*Model) SetContent

func (m *Model) SetContent(s string)

func (*Model) SetHeight

func (m *Model) SetHeight(h int)

func (*Model) SetWidth

func (m *Model) SetWidth(w int)

func (*Model) StartSpinner

func (m *Model) StartSpinner() tea.Cmd

func (*Model) StopSpinner

func (m *Model) StopSpinner()

func (Model) Update

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

func (Model) View

func (m Model) View() string

type Viewport

type Viewport = viewport.Model

Jump to

Keyboard shortcuts

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