Menu
render Components::Kbd.new { "⌘⇧S" }
Add the component to your project
Run the following command in your terminal
bundle exec essence add kbd
Copy and paste the following code into your project
# frozen_string_literal: true
class Components::Kbd < Components::Essence
BASE = "inline-flex w-fit font-medium py-0.5 px-1.5 rounded-xs border border-b-2 border-gray-950/5 bg-gray-50/50 text-gray-600 text-xs font-sans"
def initialize(**attributes)
super(**attributes)
end
def view_template(&)
kbd(**attributes, &)
end
private
def initialize_merged_classes = merge_classes([ BASE, attributes[:class] ])
end