Class: Primer::BreadcrumbComponent
- Includes:
- ViewComponent::SlotableV2
- 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: ItemComponent
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.
23 24 25 26 27 |
# File 'app/components/primer/breadcrumb_component.rb', line 23 def initialize(**system_arguments) @system_arguments = system_arguments @system_arguments[:tag] = :nav @system_arguments[:aria] = { label: "Breadcrumb" } end |
Instance Method Details
#render? ⇒ Boolean
29 30 31 |
# File 'app/components/primer/breadcrumb_component.rb', line 29 def render? items.any? end |