Shortcut RecorderProv1.0.0
Press it, then press the keys: held modifiers show as key caps at once, the first other key completes the combination, and a taken one is refused with what it's already used for.
pnpm dlx shadcn@latest add @beautiful-ui-pro/lumen-shortcut-recorderNeeds your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.
Styles didn't apply?
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
Usage
Import it and pass your content. The props that matter most are listed next.
"use client";
import * as React from "react";
import { ShortcutRecorder } from "@/components/ui/lumen/controls/shortcut-recorder";
export function SearchShortcutSetting() {
const [combo, setCombo] = React.useState("Meta+K");
return (
<div className="flex items-center justify-between gap-6">
<span>Open search</span>
<ShortcutRecorder aria-label="Open search" value={combo} onValueChange={setCombo} conflicts={{ "Meta+S": "Save", "Meta+P": "Print" }} />
</div>
);
}Props
aria-label–stringWhat the shortcut does, e.g. "Open search". Names the control.
value / defaultValue / onValueChange–stringThe combination as a string: modifiers in the order Ctrl, Alt, Shift, Meta, then the key ("Ctrl+Shift+K"). "" is none.
conflicts–Record<string, string> | (combo) => string | nullCombinations in use, with what they do. A taken one is refused and named.
allowConflictsfalsebooleanSave a taken combination anyway; the warning still shows.
requireModifiertruebooleanRefuse a single key (Shift alone doesn't count); function keys are always fine.
clearable / disabledtrue / falsebooleanA clear button (and Backspace) / off.
Show all 7 propsShow fewer
labels–Partial<ShortcutRecorderLabels>Every word, for other languages.
Source
components/ui/lumen/controls/shortcut-recorder.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.