tree

package
v1.5.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTree

func CreateTree(nodes []TreeNode, opts ...Option) string

Types

type Option

type Option func(*TreeConfig)

func WithFormatter

func WithFormatter(formatter TreeFormatter) Option

func WithPrefix

func WithPrefix(prefix string) Option

func WithStyle

func WithStyle(style lipgloss.Style) Option

func WithSuffix

func WithSuffix(suffix string) Option

type TreeConfig

type TreeConfig struct {
	common.CommonConfig

	Formatter TreeFormatter
	Style     lipgloss.Style
}

type TreeFormatter

type TreeFormatter func(any) string

type TreeNode

type TreeNode struct {
	Value     any
	Children  []TreeNode
	Formatter TreeFormatter
}

Jump to

Keyboard shortcuts

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