Class: UI::KbdGroup
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::KbdGroup
- Includes:
- KbdGroupBehavior
- Defined in:
- app/components/ui/kbd_group.rb
Overview
Group - Phlex 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
-
#initialize(classes: "", **attributes) ⇒ KbdGroup
constructor
A new instance of KbdGroup.
- #view_template(&block) ⇒ Object
Methods included from KbdGroupBehavior
#kbd_group_classes, #kbd_group_html_attributes
Constructor Details
#initialize(classes: "", **attributes) ⇒ KbdGroup
Returns a new instance of KbdGroup.
20 21 22 23 |
# File 'app/components/ui/kbd_group.rb', line 20 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#view_template(&block) ⇒ Object
25 26 27 28 29 |
# File 'app/components/ui/kbd_group.rb', line 25 def view_template(&block) kbd(**kbd_group_html_attributes) do yield if block_given? end end |