# V kbd 9

> Cross-platform Mac vs Win shortcut table

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/v-kbd-9).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/v-kbd-9
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/v-kbd-9-light-6f3a708e4330607d.png
- Registry item: https://ui.cnippet.dev/r/v-kbd-9.json
- Categories: kbd
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-kbd-9.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/kbd`

## Files

### `registry/default/variants/v-kbd-9.tsx`

```tsx
import { EditIcon, SearchIcon, UndoIcon } from "lucide-react";
import { Fragment } from "react";
import { Kbd, KbdGroup } from "@/registry/default/ui/kbd";
import { Separator } from "@/registry/default/ui/separator";

const shortcuts = [
  {
    icon: SearchIcon,
    label: "Open command palette",
    mac: ["⌘", "K"],
    win: ["Ctrl", "K"],
  },
  {
    icon: EditIcon,
    label: "Find and replace",
    mac: ["⌘", "H"],
    win: ["Ctrl", "H"],
  },
  {
    icon: UndoIcon,
    label: "Undo last action",
    mac: ["⌘", "Z"],
    win: ["Ctrl", "Z"],
  },
];

export function Pattern() {
  return (
    <div className="w-full max-w-sm">
      <div className="grid grid-cols-[1fr_auto_auto] items-center gap-x-4 gap-y-0">
        <span className="pb-2 font-medium text-muted-foreground text-xs">
          Action
        </span>
        <span className="pb-2 font-medium text-muted-foreground text-xs">
          Mac
        </span>
        <span className="pb-2 font-medium text-muted-foreground text-xs">
          Win / Linux
        </span>
        <Separator className="col-span-3" />
        {shortcuts.map(({ icon: Icon, label, mac, win }) => (
          <Fragment key={label}>
            <div className="flex items-center gap-2 py-2.5">
              <Icon
                aria-hidden="true"
                className="size-3.5 text-muted-foreground"
              />
              <span className="text-sm">{label}</span>
            </div>
            <KbdGroup className="py-2.5">
              {mac.map((k) => (
                <Kbd key={k}>{k}</Kbd>
              ))}
            </KbdGroup>
            <KbdGroup className="py-2.5">
              {win.map((k) => (
                <Kbd key={k}>{k}</Kbd>
              ))}
            </KbdGroup>
          </Fragment>
        ))}
      </div>
    </div>
  );
}
```
