Menu

Kbd

⌘⇧S
render Components::Kbd.new { "⌘⇧S" }

Installation

Add the component to your project

CLI

Run the following command in your terminal

bundle exec essence add kbd
Manually

Copy and paste the following code into your project

components/kbd.rb
# 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