Tab()
Creates a Material Design tab container for organizing content into switchable panels. Tabs provide a clean way to present multiple views within the same space.
Syntax
Result = MaterialSB::Tab(Flags = #Tab_Default, Parent = #Null)
Parameters
| Flags | Optional. Tab container flags. |
| Parent | Optional. Parent element. If #Null, uses the current parent from the stack. |
Flags
| Flag | Description |
|---|---|
#Tab_Default | Standard tab container (default) |
Return Value
Returns the tab container element (ul). Use this reference for TabAddItem().
Remarks
After creating the tab container, use TabAddItem() to add individual tabs. Each tab links to a content div with a matching ID.
You need to create the content divs separately and give them IDs that match the tab item IDs.
Example
Procedure Main(Success)
If Success
MaterialSB::Row(MaterialSB::#Grid_Container)
MaterialSB::Col(12)
; Create tab container
myTabs = MaterialSB::Tab()
; Add tab items (linking to content divs by ID)
MaterialSB::TabAddItem("Overview", myTabs, "tab-overview")
MaterialSB::TabAddItem("Features", myTabs, "tab-features")
MaterialSB::TabAddItem("Pricing", myTabs, "tab-pricing")
MaterialSB::TabAddItem("Support", myTabs, "tab-support", MaterialSB::#Tab_Disabled)
MaterialSB::CloseCurrentParent()
MaterialSB::CloseCurrentParent()
; Tab content panels (IDs must match tab items)
MaterialSB::Row(MaterialSB::#Grid_Container)
MaterialSB::Col(12)
; Overview content
MaterialSB::Append("")
MaterialSB::Append(MaterialSB::Header("Overview", 4))
MaterialSB::Append(MaterialSB::Paragraph("Welcome to our product overview. Here you'll find everything you need to get started."))
MaterialSB::Append("")
; Features content
MaterialSB::Append("")
MaterialSB::Append(MaterialSB::Header("Features", 4))
MaterialSB::Append(MaterialSB::Paragraph("Our product includes many powerful features designed to boost your productivity."))
MaterialSB::Append("")
; Pricing content
MaterialSB::Append("")
MaterialSB::Append(MaterialSB::Header("Pricing", 4))
MaterialSB::Append(MaterialSB::Paragraph("Choose from our flexible pricing plans to find the right fit for your needs."))
MaterialSB::Append("")
; Support content (disabled tab)
MaterialSB::Append("")
MaterialSB::Append(MaterialSB::Paragraph("Support content goes here."))
MaterialSB::Append("")
MaterialSB::CloseCurrentParent()
MaterialSB::CloseCurrentParent()
EndIf
EndProcedure
MaterialSB::Download(@Main())