tabs

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	// contains filtered or unexported fields
}

Component renders the tab strip and tracks the active tab.

func New

func New(items []Item) *Component

New creates a new tab component.

func (*Component) ActiveItem

func (c *Component) ActiveItem() (Item, bool)

ActiveItem returns the currently selected tab item.

func (*Component) Move

func (c *Component) Move(delta int) string

Move updates the active tab by delta and returns the new tab key.

func (*Component) SetActiveByKey

func (c *Component) SetActiveByKey(key string) bool

SetActiveByKey selects the tab matching the key.

func (*Component) View

func (c *Component) View() string

View renders the tab strip.

type Item

type Item struct {
	Key   string
	Title string
}

Item represents a single tab entry.

Jump to

Keyboard shortcuts

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