view

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderContent

func RenderContent(
	lines []string,
	vp viewport.Model,
	withScrollbar bool,
	scrollConfig scrollbar.Config,
	scrollStyles scrollbar.Styles,
) string

RenderContent renders viewport lines with an optional single-column scrollbar.

func RenderFrame

func RenderFrame(m FrameModel) string

RenderFrame renders a full-screen viewport with optional header and footer.

func Sync

func Sync(vp *viewport.Model, lines []string, width, height int) []string

Sync normalizes lines to width, sets viewport dimensions, loads the content, and enables fill-height. Returns the normalized lines for rendering.

Types

type FooterAlign

type FooterAlign string
const (
	FooterAlignLeft  FooterAlign = "left"
	FooterAlignRight FooterAlign = "right"
)

type FooterComponent

type FooterComponent struct {
	Align       FooterAlign
	BreakBefore bool
	Content     string
}

type FrameModel

type FrameModel struct {
	Footer          []FooterComponent
	Header          string
	Height          int
	Lines           []string
	Separator       string
	ScrollbarConfig scrollbar.Config
	Styles          FrameStyles
	View            viewport.Model
	Width           int
}

type FrameStyles

type FrameStyles struct {
	Separator lg.Style
	Scrollbar scrollbar.Styles
}

Jump to

Keyboard shortcuts

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