Class: PhlexKit::CommandShortcut

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/command/command_shortcut.rb

Overview

Right-aligned keyboard hint on a CommandItem, ported from shadcn/ui's CommandShortcut. See command.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ CommandShortcut

Returns a new instance of CommandShortcut.



5
6
7
# File 'app/components/phlex_kit/command/command_shortcut.rb', line 5

def initialize(**attrs)
  @attrs = attrs
end

Instance Method Details

#view_template(&block) ⇒ Object



9
10
11
# File 'app/components/phlex_kit/command/command_shortcut.rb', line 9

def view_template(&block)
  span(**mix({ class: "pk-command-shortcut" }, @attrs), &block)
end