Documentation
¶
Overview ¶
Package breadcrumb renders a path-style breadcrumb trail.
The package is stateless: callers build a slice of Crumbs, call Render, and place the result inside their own View(). Long trails collapse with an ellipsis crumb that hides the middle of the path while keeping the root and the last few segments visible.
Typical use is the top of a navigator pane: project / src / cmd / main.go with the trailing crumb tinted as the current location.
Index ¶
Constants ¶
View Source
const DefaultSeparator = " › "
DefaultSeparator is the glyph between crumbs.
Variables ¶
This section is empty.
Functions ¶
func RenderPath ¶
RenderPath splits "a/b/c" on slashes and renders the resulting crumbs. Handy when the source data is already a slash-joined path.
Types ¶
type Options ¶
type Options struct {
Separator string
// MaxItems caps the number of crumbs rendered. When the trail is
// longer, the first crumb (root) and the last MaxItems-2 are kept
// and the middle collapses into a "…" crumb. Zero means no cap.
MaxItems int
Style Style
}
Options control rendering behavior.
Click to show internal directories.
Click to hide internal directories.
