adit-firdaus

Kbd

Component

About

A keyboard key cap for displaying shortcuts, with named modifier glyphs (⌘ ⇧ ⌥ ⌃) and an optional live mode that lights up while the matching physical key is actually held down.

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

Code

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

Usage.tsx

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

export default function KbdDemo() {
  return (
    <div className="flex min-h-[200px] w-full items-center justify-center bg-background p-10 text-foreground">
      <div
        style={{
          display: "flex",
          gap: "0.5rem",
          flexWrap: "wrap",
          justifyContent: "center",
        }}
      >
        {[
          "cmd",
          "shift",
          "option",
          "control",
          "enter",
          "esc",
          "tab",
          "delete",
          "space",
          "up",
          "down",
        ].map((key) => (
          <Kbd key={key}>{key}</Kbd>
        ))}
      </div>
    </div>
  );
}

More by adit-firdaus

View all
  • Steps

    Steps

    36
  • Popover

    Popover

    3
  • Adaptive Card

    Adaptive Card

  • Box

    Box

  • Pagination

    Pagination

  • Adaptive Sheet

    Adaptive Sheet

  • Notice Bar

    Notice Bar

  • Label

    Label