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