alwkala

Kbd

Component

About

A styled keyboard key badge for displaying keyboard shortcuts and key combinations in docs, tooltips, and command menus.

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-[280px] w-full items-center justify-center bg-background p-10">
      <div className="flex flex-col items-center gap-8">
        <div className="flex items-center gap-2">
          <span className="text-sm text-muted-foreground">
            Open command menu
          </span>
          <Kbd size="md">⌘</Kbd>
          <Kbd size="md">K</Kbd>
        </div>
        <div className="flex items-center gap-2">
          <span className="text-sm text-muted-foreground">Quick open</span>
          <Kbd size="sm">Ctrl</Kbd>
          <Kbd size="sm">Shift</Kbd>
          <Kbd size="sm">P</Kbd>
        </div>
        <div className="flex items-center gap-2">
          <span className="text-sm text-muted-foreground">Close</span>
          <Kbd size="lg">Esc</Kbd>
        </div>
      </div>
    </div>
  );
}

More by alwkala

View all
  • Callout

    Callout

    7
  • Progress Bar

    Progress Bar

    1
  • Pagination

    Pagination

  • Checkbox

    Checkbox

  • Ribbon

    Ribbon

  • Rating

    Rating

  • Data Table

    Data Table

  • Navbar

    Navbar