Tab widget for Celina CLI library
This module provides a tabbed interface widget that allows switching between multiple content panels.
Types
TabPosition = enum Top, Bottom
- Position of the tab bar
Tabs = ref object of Widget tabs*: seq[Tab] activeIndex*: int position*: TabPosition tabStyle*: TabStyle showBorder*: bool
- Tab widget that displays multiple tabs with switchable content
Procs
proc defaultTabStyle(): TabStyle {....raises: [], tags: [], forbids: [].}
- Create default tab styling
proc newTabs(tabs: seq[Tab] = @[]; activeIndex: int = 0; position: TabPosition = Top; tabStyle: TabStyle = defaultTabStyle(); showBorder: bool = true): Tabs {. ...raises: [], tags: [], forbids: [].}
- Create a new Tabs widget
proc setActiveTab(widget: Tabs; index: int) {....raises: [], tags: [], forbids: [].}
- Set the active tab
proc simpleTabs(titles: seq[string]; contents: seq[Widget]): Tabs {....raises: [], tags: [], forbids: [].}
- Create tabs from title and content sequences
proc tabs(tabs: seq[Tab]; activeIndex: int = 0; position: TabPosition = Top; tabStyle: TabStyle = defaultTabStyle(); showBorder: bool = true): Tabs {. ...raises: [], tags: [], forbids: [].}
- Convenience constructor for Tabs widget
proc withBorder(widget: Tabs; showBorder: bool): Tabs {....raises: [], tags: [], forbids: [].}
- Create a copy with border enabled/disabled
proc withPosition(widget: Tabs; position: TabPosition): Tabs {....raises: [], tags: [], forbids: [].}
- Create a copy with different tab position
Methods
method getMinSize(widget: Tabs): Size {....raises: [], tags: [], forbids: [].}
- Get minimum size for tabs widget
method getPreferredSize(widget: Tabs; available: Size): Size {....raises: [], tags: [], forbids: [].}
- Get preferred size for tabs widget