tabs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2025 License: Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseStyle = lipgloss.NewStyle().Margin(1, 0, 0, 1)
View Source
var DefaultHorizontalKeyMap = KeyMap{
	Next: key.NewBinding(key.WithKeys("L")),
	Prev: key.NewBinding(key.WithKeys("H")),
}
View Source
var DefaultHorizontalStyles = Styles{
	Active:   BaseStyle.Bold(true).BorderBottom(true).BorderStyle(lipgloss.NormalBorder()),
	Inactive: BaseStyle.Faint(true),
}
View Source
var DefaultVerticalKeyMap = KeyMap{
	Next: key.NewBinding(key.WithKeys("J")),
	Prev: key.NewBinding(key.WithKeys("K")),
}
View Source
var DefaultVerticalStyles = Styles{
	Active:   BaseStyle.Bold(true).BorderRight(true).BorderStyle(lipgloss.NormalBorder()),
	Inactive: BaseStyle.Faint(true),
}

Functions

This section is empty.

Types

type DisplayFormat

type DisplayFormat string
const (
	DisplayFormatVertical   DisplayFormat = "vertical"
	DisplayFormatHorizontal DisplayFormat = "horizontal"
)

type KeyMap

type KeyMap struct {
	Next key.Binding
	Prev key.Binding
}

type Model

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

func New

func New(tabs []Tab, opts ...Options) *Model

func (*Model) Init

func (t *Model) Init() tea.Cmd

func (*Model) RenderTabs

func (t *Model) RenderTabs() string

func (*Model) Update

func (t *Model) Update(message tea.Msg) (tea.Model, tea.Cmd)

func (*Model) View

func (t *Model) View() string

type Options

type Options func(*Model)

func WithDisplayFormat

func WithDisplayFormat(display DisplayFormat) Options

func WithKeyMap

func WithKeyMap(keys KeyMap) Options

func WithStyles

func WithStyles(styles Styles) Options

func WithVerticalWidth

func WithVerticalWidth(width int) Options

func WithWrapping

func WithWrapping(wrap bool) Options

type Styles

type Styles struct {
	Active   lipgloss.Style
	Inactive lipgloss.Style
}

type Tab

type Tab struct {
	Name  string
	Model tea.Model
}

Jump to

Keyboard shortcuts

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