Class: PhlexKit::Kbd
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::Kbd
- Defined in:
- app/components/phlex_kit/kbd/kbd.rb
Overview
Keyboard-key chip, ported from shadcn/ui's Kbd. The kit's ShortcutKey
predates it (ruby_ui naming) — Kbd is the shadcn-parity spelling; group
several in a KbdGroup. .pk-kbd (kbd.css).
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ Kbd
constructor
A new instance of Kbd.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ Kbd
Returns a new instance of Kbd.
6 7 8 |
# File 'app/components/phlex_kit/kbd/kbd.rb', line 6 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
10 11 12 |
# File 'app/components/phlex_kit/kbd/kbd.rb', line 10 def view_template(&) kbd(**mix({ class: "pk-kbd" }, @attrs), &) end |