help

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package help implements a help bubble which can be used to display help information such as keymaps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Key         string
	Description string
}

Entry represents a single entry in the help bubble.

type Model

type Model struct {
	Viewport         viewport.Model
	Entries          []Entry
	Title            string
	TitleColor       TitleColor
	ViewportDisabled bool
}

Model represents the properties of a help bubble.

func New

func New(
	title string,
	titleColor TitleColor,
	entries []Entry,
) Model

New creates a new instance of a help bubble.

func (*Model) GotoBottom

func (m *Model) GotoBottom()

GotoBottom jumps to the bottom of the viewport.

func (*Model) GotoTop

func (m *Model) GotoTop()

GotoTop jumps to the top of the viewport.

func (*Model) SetSize

func (m *Model) SetSize(w, h int)

SetSize sets the size of the help bubble.

func (*Model) SetTitleColor

func (m *Model) SetTitleColor(color TitleColor)

SetTitleColor sets the color of the title.

func (*Model) SetViewportDisabled

func (m *Model) SetViewportDisabled(disabled bool)

SetViewportDisabled toggles the state of the viewport.

func (Model) Update

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

Update handles UI interactions with the help bubble.

func (Model) View

func (m Model) View() string

View returns a string representation of the help bubble.

type TitleColor

type TitleColor struct {
	Background lipgloss.AdaptiveColor
	Foreground lipgloss.AdaptiveColor
}

Jump to

Keyboard shortcuts

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