Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TabModel ¶
type TabModel interface {
// Init initializes the tab and returns an initial command.
Init() tea.Cmd
// Update handles incoming messages and updates the tab's state.
// It returns the updated model and an optional command.
Update(tea.Msg) (tea.Model, tea.Cmd)
// View renders the tab's view as a string.
View() string
// Title returns the title of the tab.
Title() string
// SetActive handles the activation state of the tab.
SetActive(bool)
}
TabModel represents the interface for a tab component in the UI. It defines the necessary methods that a tab should implement to initialize, update, render its view, and provide its title.
type TabsModel ¶
type TabsModel struct {
// contains filtered or unexported fields
}
TabsModel represents the model for managing a collection of tabs in a UI component. It includes the list of tabs, the index of the currently active tab, and a flag to indicate whether tab navigation should wrap around when reaching the end of the list.
Fields: - tabs: A slice of TabModel implementations representing the individual tabs. - active: An integer representing the index of the currently active tab. - wraparound: A boolean indicating whether tab navigation should wrap around.
Styles: - tabStyle: The style applied to inactive tabs. - activeTabStyle: The style applied to the active tab.
func NewTabsModel ¶
returns a new instance of TabsModel with the provided tabs and wraparound flag.