tom

Keyboard Shortcuts

Component

About

Display keyboard shortcuts with proper key symbols.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Keyboard Shortcuts to your project and fits it to your theme.

Code

How Keyboard Shortcuts is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { Kbd } from "@/components/ui/kbd";

export function KeySymbolsDemo() {
  return (
    <div className="flex min-h-[400px] flex-col items-center justify-center gap-6 p-8">
      <p className="text-sm text-muted-foreground">Focus the preview, then press each displayed key</p>
      <div className="flex items-center justify-center gap-3 text-2xl">
        <Kbd keys={["cmd"]} listenToKeyboard />
        <Kbd keys={["ctrl"]} listenToKeyboard />
        <Kbd keys={["alt"]} listenToKeyboard />
        <Kbd keys={["up"]} listenToKeyboard />
        <Kbd keys={["down"]} listenToKeyboard />
        <Kbd keys={["left"]} listenToKeyboard />
        <Kbd keys={["right"]} listenToKeyboard />
      </div>
    </div>
  );
}

export default { KeySymbolsDemo };

Dependencies

More by tom

View all
  • Special Text

    Special Text

    1.1K
  • Shimmer Text

    Shimmer Text

    1.1K
  • Animated Gradient

    Animated Gradient

    962
  • Tilt Card

    Tilt Card

    873
  • Marquee

    Marquee

    777
  • Text Marquee

    Text Marquee

    751
  • QR Code

    QR Code

    451
  • Animated Checkbox

    Animated Checkbox

    384