Class: UI::NavigationMenuTriggerComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::NavigationMenuTriggerComponent
- Includes:
- NavigationMenuTriggerBehavior
- Defined in:
- app/view_components/ui/navigation_menu_trigger_component.rb
Overview
TriggerComponent - ViewComponent implementation
Button that toggles the navigation menu content. Includes an animated chevron icon.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(first: false, classes: "", **attributes) ⇒ NavigationMenuTriggerComponent
constructor
A new instance of NavigationMenuTriggerComponent.
Methods included from NavigationMenuTriggerBehavior
#navigation_menu_trigger_chevron_classes, #navigation_menu_trigger_classes, #navigation_menu_trigger_data_attributes, #navigation_menu_trigger_html_attributes
Constructor Details
#initialize(first: false, classes: "", **attributes) ⇒ NavigationMenuTriggerComponent
Returns a new instance of NavigationMenuTriggerComponent.
13 14 15 16 17 |
# File 'app/view_components/ui/navigation_menu_trigger_component.rb', line 13 def initialize(first: false, classes: "", **attributes) @first = first @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'app/view_components/ui/navigation_menu_trigger_component.rb', line 19 def call content_tag :button, **.deep_merge(@attributes) do safe_join([ content, chevron_icon ]) end end |