# Live Kbd

> Shortcut keycaps that sink as you press the real keys, then fire the action, so people learn the shortcut by using it.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Components › State Changes |
| Live preview | https://uibrik.com/components/live-kbd |
| Writes | 1 file into `components/uibrik/live-kbd/` |
| Packages | `motion` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 22, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/live-kbd.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/live-kbd`.

Can't run commands? https://uibrik.com/components/live-kbd/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { LiveKbd } from "@/components/uibrik/live-kbd/live-kbd";

<LiveKbd
  keys={["mod", "k"]}
  label="Search"
  listen
  preventDefault
  onTrigger={() => {}}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/live-kbd.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `keys` | `string[]` | `["mod","k"]` | The shortcut. "mod" is ⌘ on Apple devices and Ctrl elsewhere. |
| `label` | `string` | `"Search"` | Text before the keys. Empty shows the keys alone. |
| `listen` | `boolean` | `true` | Listen for the shortcut on the whole page. |
| `preventDefault` | `boolean` | `true` | Stop the browser's own action for the shortcut. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `onTrigger` | `() => void` |  | Called when the shortcut is pressed or the button is clicked. |
| `className` | `string` |  | Classes for the button. |

## Where it fits

- **Search and command triggers**: Holding ⌘ sinks its keycap first, so people see the shortcut working before it fires. Pairs with [Command Menu](https://uibrik.com/components/command-menu.md) and [Search](https://uibrik.com/components/search.md) (Pro).
- **Docs and onboarding**: Keycaps that react to the real keyboard teach shortcuts better than a static hint. Pairs with [Product Tour](https://uibrik.com/components/product-tour.md) (Pro).
- **Toolbars and menus**: Shows ⌘ on Apple devices and Ctrl elsewhere, so the hint is right for everyone. Pairs with [Dropdown Menu](https://uibrik.com/components/dropdown-menu.md) and [Context Menu](https://uibrik.com/components/context-menu.md).

## Same shelf: State Changes

- [Mute Toggle](https://uibrik.com/components/mute-toggle.md): A sound toggle whose waves fold away one at a time before a slash cuts through the speaker, and come back in reverse.
- [Notification Bell](https://uibrik.com/components/notification-bell.md): A notification bell that swings when something new arrives, rolls its badge count up, and drops the badge into the bell once read.
- [Password Peek](https://uibrik.com/components/password-peek.md): A password field whose eye blinks as you toggle it, and whose characters rise into view left to right instead of snapping from dots.
- [Pin Tab](https://uibrik.com/components/pin-tab.md) (Pro): A tab bar where pinning shrinks a tab to its icon and slides it to the front, and unpinning grows it back with its title.
- [Presence Dot](https://uibrik.com/components/presence-dot.md) (Pro): An avatar status dot that morphs between online, away, busy and offline, and opens from the dot itself into a tiny picker that previews each status as you hover.
- [Read Receipts](https://uibrik.com/components/read-receipts.md): A message bubble whose clock turns into one tick, then two, then fills with colour once the message is read.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/live-kbd/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
