Class: Primer::BreadcrumbComponent
- Includes:
- ViewComponent::Slotable
- Defined in:
- app/components/primer/breadcrumb_component.rb
Overview
Use breadcrumbs to display page hierarchy within a section of the site. All of the items in the breadcrumb “trail” are links except for the final item, which is a plain string indicating the current page.
Defined Under Namespace
Classes: BreadcrumbItem
Constant Summary
Constants inherited from Component
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
-
#initialize(**system_arguments) ⇒ BreadcrumbComponent
constructor
A new instance of BreadcrumbComponent.
- #render? ⇒ Boolean
Methods inherited from Component
Methods included from ViewHelper
Methods included from JoinStyleArgumentsHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean
Methods included from ClassNameHelper
Constructor Details
#initialize(**system_arguments) ⇒ BreadcrumbComponent
Returns a new instance of BreadcrumbComponent.
18 19 20 21 22 |
# File 'app/components/primer/breadcrumb_component.rb', line 18 def initialize(**system_arguments) @system_arguments = system_arguments @system_arguments[:tag] = :nav @system_arguments[:aria] = { label: "Breadcrumb" } end |
Instance Method Details
#render? ⇒ Boolean
24 25 26 |
# File 'app/components/primer/breadcrumb_component.rb', line 24 def render? items.any? end |