utilComponents

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package utilComponents provides reusable UI components for the OpenCode TUI, including a simple list component for displaying selectable items.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleList

type SimpleList[T SimpleListItem] interface {
	tea.Model
	layout.Bindings
	SetMaxWidth(maxWidth int)
	GetSelectedItem() (item T, idx int)
	SetItems(items []T)
	GetItems() []T
	CycleNext()
	CyclePrevious()
}

SimpleList is a generic interface for a list component that displays selectable items.

func NewSimpleList

func NewSimpleList[T SimpleListItem](items []T, maxVisibleItems int, fallbackMsg string, useAlphaNumericKeys bool) SimpleList[T]

type SimpleListItem

type SimpleListItem interface {
	Render(selected bool, width int) string
}

SimpleListItem is an interface that types must implement to be displayed in a SimpleList.

Jump to

Keyboard shortcuts

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