Class: UI::KbdGroupComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::KbdGroupComponent
- Includes:
- KbdGroupBehavior
- Defined in:
- app/view_components/ui/kbd_group_component.rb
Overview
GroupComponent - ViewComponent implementation
Groups multiple keyboard keys together with consistent spacing. Useful for representing keyboard combinations like “Ctrl + B”. Uses KbdGroupBehavior concern for shared styling logic.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", **attributes) ⇒ KbdGroupComponent
constructor
A new instance of KbdGroupComponent.
Methods included from KbdGroupBehavior
#kbd_group_classes, #kbd_group_html_attributes
Constructor Details
#initialize(classes: "", **attributes) ⇒ KbdGroupComponent
Returns a new instance of KbdGroupComponent.
20 21 22 23 |
# File 'app/view_components/ui/kbd_group_component.rb', line 20 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/view_components/ui/kbd_group_component.rb', line 25 def call attrs = kbd_group_html_attributes content_tag :kbd, **attrs.merge(@attributes) do content end end |