tabs

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package tabs provides a tab bar component for navigation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model represents the tab bar component.

func New

func New(styles *theme.Styles, tabs []string, active int) Model

New creates a new tab bar model.

func (Model) Active

func (m Model) Active() int

Active returns the current active tab index.

func (Model) ActiveTab

func (m Model) ActiveTab() string

ActiveTab returns the name of the active tab.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (*Model) Next

func (m *Model) Next()

Next moves to the next tab.

func (*Model) Prev

func (m *Model) Prev()

Prev moves to the previous tab.

func (*Model) SetActive

func (m *Model) SetActive(index int)

SetActive sets the active tab index.

func (*Model) SetStyles added in v0.5.0

func (m *Model) SetStyles(styles *theme.Styles)

SetStyles updates the component's styles (for runtime theme changes).

func (*Model) SetWidth

func (m *Model) SetWidth(width int)

SetWidth sets the tab bar width.

func (Model) Update

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

Update implements tea.Model.

func (Model) View

func (m Model) View() string

View implements tea.Model.

Jump to

Keyboard shortcuts

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