navbar

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Navbar(children ...g.Node) g.Node

Navbar creates a responsive navigation bar with mobile menu

Example:

menu.Navbar(
    menu.NavbarBrand(g.Text("My App")),
    menu.NavbarMenu(
        menu.Item("/", g.Text("Home"), menu.Active()),
        menu.Item("/about", g.Text("About")),
    ),
    menu.NavbarActions(
        button.Ghost(g.Text("Sign In")),
    ),
)
func NavbarActions(children ...g.Node) g.Node

NavbarActions creates the right-side actions section

Example:

menu.NavbarActions(
    button.Ghost(g.Text("Sign In")),
    button.Primary(g.Text("Sign Up")),
)
func NavbarBrand(children ...g.Node) g.Node

NavbarBrand creates the brand/logo section

Example:

menu.NavbarBrand(
    html.Img(g.Attr("src", "/logo.svg"), g.Attr("alt", "Logo")),
    g.Text("My App"),
)
func NavbarMenu(children ...g.Node) g.Node

NavbarMenu creates the navigation links section On mobile, this appears in the drawer

Example:

menu.NavbarMenu(
    menu.Item("/", g.Text("Home")),
    menu.Item("/docs", g.Text("Docs")),
)
func NavbarWithOptions(opts []NavbarOption, children ...g.Node) g.Node

NavbarWithOptions creates navbar with custom options

Types

type NavbarOption func(*NavbarProps)

NavbarOption is a functional option for configuring navbar

func WithFixed

func WithFixed() NavbarOption

WithFixed makes navbar fixed position

func WithNavbarAttrs

func WithNavbarAttrs(attrs ...g.Node) NavbarOption

WithNavbarAttrs adds custom attributes to navbar

func WithNavbarClass

func WithNavbarClass(class string) NavbarOption

WithNavbarClass adds custom classes to navbar

func WithSticky

func WithSticky() NavbarOption

WithSticky makes navbar sticky position

func WithTransparent

func WithTransparent() NavbarOption

WithTransparent makes navbar background transparent

type NavbarProps struct {
	Fixed       bool
	Sticky      bool
	Transparent bool
	Class       string
	Attrs       []g.Node
}

NavbarProps defines navbar configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL