Class: UI::KbdComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::KbdComponent
- Includes:
- KbdBehavior
- Defined in:
- app/view_components/ui/kbd_component.rb
Overview
KbdComponent - ViewComponent implementation
Displays textual user input from keyboard, helping users understand keyboard shortcuts and interactions within applications. Uses KbdBehavior concern for shared styling logic.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", **attributes) ⇒ KbdComponent
constructor
A new instance of KbdComponent.
Methods included from KbdBehavior
#kbd_classes, #kbd_html_attributes
Constructor Details
#initialize(classes: "", **attributes) ⇒ KbdComponent
Returns a new instance of KbdComponent.
19 20 21 22 |
# File 'app/view_components/ui/kbd_component.rb', line 19 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/view_components/ui/kbd_component.rb', line 24 def call attrs = kbd_html_attributes content_tag :kbd, **attrs.merge(@attributes) do content end end |