Organize UI with Sections and Tabs
mainWindUI uses a hierarchical structure to organize elements:
- Window: The root container.
- Sections: Groups of elements within a Tab or Window.
- Tabs: High-level navigation pages.
Hierarchy Flow:
Window -> Section -> Tab (Note: In this API, Tabs can be children of Sections, or Sections can be children of Tabs).
Key Methods:
Window:Section({ Title = string, Opened = boolean?, ... }): Creates a new section.Section:Tab({ Title = string, Icon = string?, Desc = string?, Locked = boolean? }): Creates a tab within a section.Window:Tab({ Title = string, Icon = string?, Locked = boolean? }): Creates a top-level tab.Section:Section({ ... }): Creates a nested section within a section.Tab:Section({ ... }): Creates a section within a tab.
local Sections = {
Main = Window:Section({ Title = "Main Features", Opened = true }),
Settings = Window:Section({ Title = "Settings", Opened = true })
}
local Tabs = {
Elements = Sections.Main:Tab({ Title = "UI Elements", Icon = "layout-grid" }),
Appearance = Sections.Settings:Tab({ Title = "Appearance", Icon = "brush" }),
LockedTab = Window:Tab({ Title = "Locked", Icon = "bird", Locked = true })
}