# Keyboard Shortcuts 01

> A simple keyboard shortcuts block

A shadcn/ui block from the [@shadcnui-blocks](https://shadcnui-blocks.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/shadcnui-blocks/keyboard-shortcuts-01).

- Page, with a live preview: https://shadcn.exchange/r/shadcnui-blocks/keyboard-shortcuts-01
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/shadcnui-blocks/keyboard-shortcuts-01-light-e5741db6f141bea4.png
- Registry item: https://shadcnui-blocks.com/r/keyboard-shortcuts-01.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://shadcnui-blocks.com/r/keyboard-shortcuts-01.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: `card`, `kbd`

## Files

### `src/registry/blocks/radix/keyboard-shortcuts-01/components/keyboard-shortcuts.tsx`

```tsx
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/registry/bases/radix/ui/card";
import { Kbd } from "@/registry/bases/radix/ui/kbd";

export default function KeyboardShortcuts() {
  return (
    <div className="px-6 py-12">
      <Card className="mx-auto max-w-sm bg-muted/20">
        <CardHeader>
          <CardTitle className="font-medium">Keyboard Shortcuts</CardTitle>
          <CardDescription>
            A list of keyboard shortcuts for the application
          </CardDescription>
        </CardHeader>
        <CardContent>
          <ul className="-mx-1 divide-y divide-border/50">
            {shortcuts.map((shortcut) => (
              <li
                className="flex items-center justify-between px-1 py-2.25"
                key={shortcut.shortcut}
              >
                <span className="text-sm">{shortcut.description}</span>
                <Kbd className="border border-border/50 px-1.5 font-mono">
                  {shortcut.shortcut}
                </Kbd>
              </li>
            ))}
          </ul>
        </CardContent>
      </Card>
    </div>
  );
}

const shortcuts = [
  {
    shortcut: "Ctrl + K",
    description: "Open the search bar",
  },
  {
    shortcut: "Ctrl + N",
    description: "Open a new window",
  },
  {
    shortcut: "Ctrl + O",
    description: "Open a file",
  },
  {
    shortcut: "Ctrl + P",
    description: "Open the settings",
  },
  {
    shortcut: "Ctrl + Q",
    description: "Quit the application",
  },
  {
    shortcut: "Ctrl + R",
    description: "Refresh the page",
  },
  {
    shortcut: "Ctrl + S",
    description: "Save the file",
  },
  {
    shortcut: "Ctrl + T",
    description: "Open a new tab",
  },
  {
    shortcut: "Ctrl + W",
    description: "Close the tab",
  },
  {
    shortcut: "Ctrl + X",
    description: "Cut the selection",
  },
  {
    shortcut: "Ctrl + Y",
    description: "Redo the last action",
  },
  {
    shortcut: "Ctrl + Z",
    description: "Undo the last action",
  },
  {
    shortcut: "Ctrl + [",
    description: "Go back",
  },
  {
    shortcut: "Ctrl + ]",
    description: "Go forward",
  },
];
```
