breadcrumb

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package breadcrumb provides breadcrumb navigation components following shadcn/ui patterns. Breadcrumbs show the current page's location within a navigational hierarchy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Breadcrumb(children ...g.Node) g.Node

Breadcrumb creates a breadcrumb navigation container

Example:

breadcrumb.Breadcrumb(
    breadcrumb.Item("/", g.Text("Home")),
    breadcrumb.Item("/docs", g.Text("Docs")),
    breadcrumb.Page(g.Text("Components")),
)
func BreadcrumbWithOptions(opts []Option, children ...g.Node) g.Node

BreadcrumbWithOptions creates breadcrumb with custom options

func Ellipsis

func Ellipsis() g.Node

Ellipsis creates a breadcrumb ellipsis for collapsed items

Example:

breadcrumb.Ellipsis()

func Item

func Item(href string, label g.Node) g.Node

Item creates a breadcrumb item with a link

Example:

breadcrumb.Item("/docs", g.Text("Documentation"))
func Link(href string, label g.Node) g.Node

Link creates a breadcrumb link without the separator (for custom layouts)

Example:

breadcrumb.Link("/docs", g.Text("Documentation"))

func Page

func Page(label g.Node) g.Node

Page creates the current page breadcrumb (not a link)

Example:

breadcrumb.Page(g.Text("Current Page"))

func Separator

func Separator() g.Node

Separator creates a breadcrumb separator

Example:

breadcrumb.Separator()

func SeparatorWithIcon

func SeparatorWithIcon(icon g.Node) g.Node

SeparatorWithIcon creates a separator with custom icon

Example:

breadcrumb.SeparatorWithIcon(g.Text("/"))

Types

type BreadcrumbProps struct {
	Separator g.Node
	MaxItems  int // 0 means no limit
	Class     string
	Attrs     []g.Node
}

BreadcrumbProps defines breadcrumb configuration

type Option

type Option func(*BreadcrumbProps)

Option is a functional option for configuring breadcrumbs

func WithAttrs

func WithAttrs(attrs ...g.Node) Option

WithAttrs adds custom attributes

func WithClass

func WithClass(class string) Option

WithClass adds custom classes

func WithMaxItems

func WithMaxItems(maxItems int) Option

WithMaxItems sets maximum items to display (middle items collapse to ellipsis)

func WithSeparator

func WithSeparator(sep g.Node) Option

WithSeparator sets custom separator (default is chevron)

Jump to

Keyboard shortcuts

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