Browse documentation

Breadcrumb

Show the user's place in a hierarchy with a compact trail.

Import

Load the optional component layer before using the examples below.

Ruby
require "zaniah/ui"

Example

Pass a label alone for the current page, or a label/callback pair for a navigable ancestor.

Rendered example
Home and Gallery breadcrumb in Zaniah's navigation examples.
Rendered by Zaniah's headless backend.
Ruby
open_home = ->(*) { puts "Home" }
Zaniah::UI::Breadcrumb.new([
  ["Home", open_home],
  ["Components", open_home],
  ["Breadcrumb", nil]
])

Current page

End the trail with the current page. Avoid links that point back to the page already open.

API summary

Constructor options and behaviors are drawn from the component reference.

ComponentConstructor and methodsVariants or behavior
Breadcrumb(items)labels or label/callback pairs

Accessibility

Breadcrumb exposes navigation semantics; links are individually focusable.

ComponentSemantic role
Breadcrumbnavigation/link