Class: Shadcn::KbdComponent

Inherits:
BaseComponent show all
Defined in:
app/components/shadcn/kbd_component.rb

Overview

Kbd component for displaying keyboard shortcuts Matches shadcn/ui Kbd component

Examples:

Basic keyboard shortcut

<%= render Shadcn::KbdComponent.new { "⌘" } %>

Multiple keys

<%= render Shadcn::KbdComponent.new { "⌘K" } %>

With key combination


  <%= render Shadcn::KbdComponent.new { "Ctrl" } %>
  +
  <%= render Shadcn::KbdComponent.new { "C" } %>

Constant Summary collapse

BASE_CLASSES =
'pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100'

Instance Attribute Summary

Attributes inherited from BaseComponent

#class_name, #data, #html_options

Method Summary

Methods inherited from BaseComponent

#content, #initialize

Methods included from Rails::Helpers::ClassNameHelper

#cn

Constructor Details

This class inherits a constructor from Shadcn::BaseComponent