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 included from Status::Dsl
Constants included from ViewHelper
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 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.
24 25 26 27 28 |
# File 'app/components/primer/breadcrumb_component.rb', line 24 def initialize(**system_arguments) @system_arguments = system_arguments @system_arguments[:tag] = :nav @system_arguments[:aria] = { label: "Breadcrumb" } end |
Instance Method Details
#render? ⇒ Boolean
30 31 32 |
# File 'app/components/primer/breadcrumb_component.rb', line 30 def render? items.any? end |