Class: Primer::MenuComponent
- Includes:
- ViewComponent::SlotableV2
- Defined in:
- app/components/primer/menu_component.rb
Overview
Use menus to create vertical lists of navigational links.
Constant Summary
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
-
#initialize(**system_arguments) ⇒ MenuComponent
constructor
A new instance of MenuComponent.
- #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) ⇒ MenuComponent
Returns a new instance of MenuComponent.
58 59 60 61 62 63 64 65 |
# File 'app/components/primer/menu_component.rb', line 58 def initialize(**system_arguments) @system_arguments = system_arguments @system_arguments[:tag] = :nav @system_arguments[:classes] = class_names( "menu", @system_arguments[:classes] ) end |
Instance Method Details
#render? ⇒ Boolean
67 68 69 |
# File 'app/components/primer/menu_component.rb', line 67 def render? items.any? end |