navbar

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 2 Imported by: 0

README

Nav Component

Navigation menu with support for icons.

Import

"github.com/tinywasm/components/nav"

Usage

n := &nav.Nav{
    Items: []nav.NavItem{
        {Label: "Dashboard", Route: "dashboard", Icon: "icon-home"},
        {Label: "Settings", Route: "settings", Icon: "icon-cog"},
    },
}

Properties

  • Items ([]NavItem): List of navigation items.
    • Label (string): Display text.
    • Route (string): Target route/hash.
    • Icon (string): SVG sprite ID for icon (optional).

Back to Catalog

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NavLink(text, hash, icon string) *Element

NavLink creates a navigation link with optional icon.

Types

type NavBar struct {
	Element
	Items []NavBarItem
}
func (n *NavBar) IconSvg() map[string]string
func (n *NavBar) Render() *Element
func (n *NavBar) RenderCSS() *Stylesheet
type NavBarItem struct {
	Label string
	Route string // e.g., "users", "products"
	Icon  string // optional icon ID
}

Jump to

Keyboard shortcuts

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