Ballmac UI home

Keyboard Shortcuts

A searchable shortcut cheat sheet, inline or in a dialog opened by pressing ?, with Command or Ctrl keys chosen for the viewer's platform and spoken key names.

General

  • Open command menuCtrl plus K
  • Show shortcuts?
  • Toggle sidebarCtrl plus B
  • SaveCtrl plus S

Navigation

  • Go to inboxG then I
  • Go to projectsG then P
  • Next itemJ
  • Previous itemK

Editing

  • BoldCtrl plus B
  • Move line upAlt plus Up arrow
  • Duplicate lineShift plus Alt plus Down arrow
  • UndoCtrl plus Z

Installation

$ pnpm dlx shadcn@latest add @ballmac/keyboard-shortcuts

Usage

import { KeyboardShortcuts, KeyboardShortcutsDialog } from "@/components/ballmac/keyboard-shortcuts"

The full example is in the Code tab above.

Examples

Dialog opened with ?

API reference

<KeyboardShortcuts>

PropTypeDefault
groups*

Shortcuts, grouped.

ShortcutGroup[]—
searchable

Show a search box that filters by action or key.

booleantrue
platform

Which key labels to draw. "auto" picks Mac or other after hydration.

ShortcutPlatform | "auto"—
searchPlaceholder

Placeholder of the search box.

string—
columns

Number of columns on wide containers.

1 | 22

<KeyboardShortcutsDialog>

PropTypeDefault
open

Controlled open state.

boolean—
defaultOpen

Initial open state.

booleanfalse
onOpenChange

Called when the dialog opens or closes.

(open: boolean) => void—
hotkey

Key that opens the dialog from anywhere outside a text field. Set to `null` to turn it off.

string | null"?"
title

Dialog heading.

string—
description

Line under the heading.

string—
className

Classes for the dialog panel.

string—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
?Opens the dialog when focus is not in a text field
EscapeCloses the dialog
Screen readersKeys read as 'Command plus K', sequences as 'G then I'; the filtered count is announced

Use with AI

groups is [{ title, shortcuts: [{ label, keys, sequence?, description? }] }]. Use 'Mod' for Cmd on Mac and Ctrl elsewhere. <KeyboardShortcutsDialog hotkey='?'> opens from anywhere outside a text field. platform='auto' corrects after hydration. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Keyboard Shortcuts (@ballmac/keyboard-shortcuts) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • A help overlay for apps with many shortcuts
  • Docs pages that list hotkeys

Not for

  • A single hint beside a button (shortcut-hint)
  • Binding the shortcuts themselves; this only displays them

Registry JSON: https://ui.ballmac.com/r/keyboard-shortcuts.json

Credits

Free to use in personal and commercial projects.