Ballmac UI home

Shortcut Hint

A compact accessible keycap sequence paired with the action it performs.

Installation

$ pnpm dlx shadcn@latest add @ballmac/shortcut-hint

Usage

import { ShortcutHint } from "@/components/ballmac/shortcut-hint"

The full example is in the Code tab above.

Examples

States and variants

API reference

PropTypeDefault
keys*

Keys in order, such as ["⌘", "K"].

string[]—
label*

Action explained by the shortcut.

string—
compact

Render compact keycaps for dense menus.

booleanfalse

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
NoneFull shortcut meaning is in the accessible name

Use with AI

A compact accessible keycap sequence paired with the action it performs. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Shortcut Hint (@ballmac/shortcut-hint) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Label a command in a menu
  • Teach an optional keyboard shortcut

Not for

  • Use kbd for an isolated key

Registry JSON: https://ui.ballmac.com/r/shortcut-hint.json

Credits

Free to use in personal and commercial projects.

npm
None