Class: PhlexKit::Kbd

Inherits:
BaseComponent show all
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

Methods inherited from BaseComponent

#on

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_templateObject



10
11
12
# File 'app/components/phlex_kit/kbd/kbd.rb', line 10

def view_template(&)
  kbd(**mix({ class: "pk-kbd" }, @attrs), &)
end