Documentation
¶
Overview ¶
Package carousel renders a horizontal strip of labels with one active, and wraps navigation around the ends. It drives both the top-level section tabs and the per-issue detail sub-tabs, so the same selection behavior is shared.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// Separator sits between items (default two spaces).
Separator string
// ActiveStyle / InactiveStyle style the labels. Zero values render plainly.
ActiveStyle lipgloss.Style
InactiveStyle lipgloss.Style
// contains filtered or unexported fields
}
Model is a wrapping tab strip.
func New ¶
New returns a carousel over the given items with the first active. It returns a pointer because every mutating method has a pointer receiver.
func (*Model) ActiveItem ¶
ActiveItem returns the active label, or "" when empty.
func (*Model) Items ¶
Items returns a copy of the current labels so external mutation cannot bypass SetItems and corrupt the active index.
func (*Model) Next ¶
func (m *Model) Next()
Next moves to the following item, wrapping to the first after the last.
func (*Model) Prev ¶
func (m *Model) Prev()
Prev moves to the previous item, wrapping to the last before the first.