Documentation
¶
Overview ¶
Package tabs renders a horizontal row of labeled tabs with one active label. It's a primitive: the component doesn't own the panels or their content. A parent model decides what to render below the tab row based on Active().
Keys: left/right and tab/shift+tab cycle through the labels. Cycling wraps at the ends. Update returns the new Tabs and never produces a tea.Cmd; parents can listen for changes via Active().
Index ¶
Constants ¶
const Separator = " · "
Separator placed between adjacent tab labels.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tabs ¶
type Tabs struct {
// contains filtered or unexported fields
}
Tabs is a horizontal row of selectable labels.
func New ¶
New constructs a Tabs primitive with the given theme. The label slice is empty until WithTabs is called.
func (Tabs) Update ¶
Update handles cycling keys. Left/Right and Tab/Shift+Tab move the active index by one, wrapping at the ends. All other messages pass through.
func (Tabs) View ¶
View renders the labeled row. The active label is bold, underlined, and uses the theme's Primary color; inactive labels use Muted.
func (Tabs) WithActive ¶
WithActive selects the active tab by index. Out-of-range values are clamped into the valid range; an empty label set forces 0.
