NavbarAddLogo()
Adds a brand logo or text to the navbar. Can be text-only or include an image.
Syntax
Result = MaterialSB::NavbarAddLogo(Text.s, ImagePath.s = "", Link.s = "", Flags = #Navbar_Default, Parent = #Null)
Parameters
| Text.s | The brand name or alt text for the logo image. |
| ImagePath.s | Optional. Path to a logo image. If provided, displays an image instead of text. |
| Link.s | Optional. URL to navigate to when the logo is clicked. |
| Flags | Optional. Alignment flags for the logo position. |
| Parent | Optional. Parent navbar element. |
Flags
| Flag | Description |
|---|---|
#Navbar_Default | Left-aligned logo (default) |
#Navbar_Align_Center | Center the logo |
#Navbar_Align_Right | Right-align the logo |
Return Value
Returns the logo anchor element.
Example
Procedure Main(Success)
If Success
; Text logo (left-aligned by default)
MaterialSB::Navbar(MaterialSB::#Navbar_Shadow2)
MaterialSB::NavbarAddLogo("My App")
MaterialSB::NavbarAddLink("Home", "#")
MaterialSB::NavbarAddLink("About", "#about")
EndIf
EndProcedure
; Alternative: Image logo with link
Procedure MainWithImage(Success)
If Success
MaterialSB::Navbar(MaterialSB::#Navbar_Shadow2)
MaterialSB::NavbarAddLogo("Company Name", "images/logo.png", "https://example.com")
MaterialSB::NavbarAddLink("Products", "#products")
EndIf
EndProcedure
; Centered logo
Procedure MainCentered(Success)
If Success
MaterialSB::Navbar(MaterialSB::#Navbar_Shadow2)
MaterialSB::NavbarAddLogo("Centered Brand", "", "", MaterialSB::#Navbar_Align_Center)
EndIf
EndProcedure
MaterialSB::Download(@Main())