# Keyboard Shortcuts

Formatted keyboard shortcut reference table



<ComponentPreview base="ink" name="keyboard-shortcuts-demo" />

Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @termcn/keyboard-shortcuts
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource base="ink" name="keyboard-shortcuts" title="components/ui/keyboard-shortcuts.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

Usage [#usage]

```tsx
import { KeyboardShortcuts } from "@/components/ui/keyboard-shortcuts";
```

```tsx
<KeyboardShortcuts
  title="Editor Shortcuts"
  shortcuts={[
    { key: "Ctrl+S", description: "Save file" },
    { key: "Ctrl+Z", description: "Undo" },
    { key: "Ctrl+F", description: "Find" },
  ]}
/>
```

API Reference [#api-reference]

KeyboardShortcuts [#keyboardshortcuts]

| Prop        | Type         | Default    |
| ----------- | ------------ | ---------- |
| `shortcuts` | `Shortcut[]` | `required` |
| `columns`   | `number`     | `1`        |
| `title`     | `string`     | -          |

Shortcut [#shortcut]

| Prop          | Type     | Default    |
| ------------- | -------- | ---------- |
| `key`         | `string` | `required` |
| `description` | `string` | `required` |
| `category`    | `string` | -          |
