SidenavAddLink()

Adds a navigation link to a sidenav, optionally with a Material Icon.

Syntax
Result = MaterialSB::SidenavAddLink(Text.s, Link.s, Icon.s = "", Parent = #Null)
Parameters
Text.s The link text to display.
Link.s The URL or anchor to navigate to.
Icon.s Optional. Material Icon name (e.g., "home", "settings", "email").
Parent Optional. Parent sidenav element. If #Null, uses the current sidenav.
Return Value

Returns the list item element containing the link.

Remarks

Icons are displayed to the left of the link text. See the Material Icons reference for available icon names.

Example
Procedure Main(Success)
  If Success
    MaterialSB::Navbar(MaterialSB::#Navbar_Shadow2)
    MaterialSB::NavbarAddSidenavTrigger("main-sidenav")
    MaterialSB::NavbarAddLogo("My App")
    
    mySidenav = MaterialSB::Sidenav()
    MaterialSB::SetAttribute(mySidenav, "id", "main-sidenav")
    
    ; Links with icons
    MaterialSB::SidenavAddLink("Dashboard", "#dashboard", "dashboard")
    MaterialSB::SidenavAddLink("Profile", "#profile", "person")
    MaterialSB::SidenavAddLink("Messages", "#messages", "email")
    MaterialSB::SidenavAddLink("Settings", "#settings", "settings")
    
    ; Divider
    MaterialSB::SidenavAddDivider()
    
    ; Links without icons
    MaterialSB::SidenavAddLink("Help", "#help")
    MaterialSB::SidenavAddLink("Logout", "#logout")
    
    MaterialSB::Init(mySidenav, #Null)
    
    MaterialSB::Row(MaterialSB::#Grid_Container)
      MaterialSB::Col(12)
        MaterialSB::Append(MaterialSB::Header("Main Content", 2))
      MaterialSB::CloseCurrentParent()
    MaterialSB::CloseCurrentParent()
  EndIf
EndProcedure

MaterialSB::Download(@Main())
See Also

Sidenav(), SidenavAddDivider(), SidenavAddSubheader()