Navbar()

Creates a Material Design navigation bar at the top (or bottom) of the page. The navbar automatically handles responsive behavior with mobile dropdown menus.

Syntax
Result = MaterialSB::Navbar(Flags = #Navbar_Default)
Parameters
Flags Optional. Combination of navbar flags for positioning and styling.
Flags
FlagDescription
#Navbar_DefaultStandard top navbar (default)
#Navbar_Align_RightAlign logo to the right
#Navbar_Align_CenterCenter the logo
#Navbar_BottomPosition navbar at the bottom of the viewport
#Navbar_Shadow1Light shadow (z-depth-1)
#Navbar_Shadow2Medium shadow (z-depth-2)
#Navbar_Shadow3Heavy shadow (z-depth-5)
#Navbar_ContainerAdd container class to constrain width
Return Value

Returns the navbar wrapper element.

Remarks

The navbar is automatically prepended to the document body. Use NavbarAddLogo() to add a brand/logo, and NavbarAddLink() to add navigation links.

Links added with NavbarAddLink() automatically create a responsive dropdown menu that appears on medium and small screens.

For mobile navigation with a sidenav, use NavbarAddSidenavTrigger() to add a hamburger menu button.

Example
Procedure Main(Success)
  If Success
    ; Create navbar with shadow
    MaterialSB::Navbar(MaterialSB::#Navbar_Shadow2 | MaterialSB::#Navbar_Container)
    
    ; Add logo (left-aligned by default)
    MaterialSB::NavbarAddLogo("My App")
    
    ; Add navigation links (appear right-aligned)
    MaterialSB::NavbarAddLink("Home", "#home")
    MaterialSB::NavbarAddLink("Features", "#features")
    MaterialSB::NavbarAddLink("Pricing", "#pricing")
    MaterialSB::NavbarAddLink("Contact", "#contact")
    
    ; Main content
    MaterialSB::Row(MaterialSB::#Grid_Container)
      MaterialSB::Col(12)
        MaterialSB::Append(MaterialSB::Header("Welcome to My App", 3))
        MaterialSB::Append(MaterialSB::Paragraph("This is the main content area."))
      MaterialSB::CloseCurrentParent()
    MaterialSB::CloseCurrentParent()
  EndIf
EndProcedure

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

NavbarAddLogo(), NavbarAddLink(), NavbarAddSidenavTrigger(), Sidenav()