195 Pro components and page blocks

Get Pro

Updated

Live Kbd

New

Preview

Customize

Installation

npx shadcn@latest add https://uibrik.com/r/live-kbd.json
Adds the files to components/uibrik/live-kbd and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/live-kbd.

Usage

import { LiveKbd } from "@/components/uibrik/live-kbd/live-kbd";​<LiveKbd  keys={["mod", "k"]}  label="Search"  listen  preventDefault  onTrigger={() => {}}/>

Where to use Live Kbd

  • Search and command triggers

    Holding ⌘ sinks its keycap first, so people see the shortcut working before it fires.

    Pairs with Command Menu and Search

  • Docs and onboarding

    Keycaps that react to the real keyboard teach shortcuts better than a static hint.

    Pairs with Product Tour

  • Toolbars and menus

    Shows ⌘ on Apple devices and Ctrl elsewhere, so the hint is right for everyone.

    Pairs with Dropdown Menu and Context Menu

Props

LiveKbd
keys
Type string[]
["mod","k"]
The shortcut. "mod" is ⌘ on Apple devices and Ctrl elsewhere.
label
Type string
"Search"
Text before the keys. Empty shows the keys alone.
listen
Type boolean
true
Listen for the shortcut on the whole page.
preventDefault
Type boolean
true
Stop the browser's own action for the shortcut.
onTrigger
Type () => void
–
Called when the shortcut is pressed or the button is clicked.
className
Type string
–
Classes for the button.