Class: Primer::BreadcrumbComponent
- 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 included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
-
#initialize(**system_arguments) ⇒ BreadcrumbComponent
constructor
A new instance of BreadcrumbComponent.
- #render? ⇒ Boolean
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
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 |