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
| Flag | Description |
|---|---|
#Navbar_Default | Standard top navbar (default) |
#Navbar_Align_Right | Align logo to the right |
#Navbar_Align_Center | Center the logo |
#Navbar_Bottom | Position navbar at the bottom of the viewport |
#Navbar_Shadow1 | Light shadow (z-depth-1) |
#Navbar_Shadow2 | Medium shadow (z-depth-2) |
#Navbar_Shadow3 | Heavy shadow (z-depth-5) |
#Navbar_Container | Add 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()