Shortcut

Shortcut (also known as Keyboard or KBD) support ensures smooth navigation via the keyboard. It's essential for users who rely on keyboard-only interaction and appreciated by power users for quick, efficient access to features.

Example

Installation

Install following dependencies:

npm install react-aria-components tw-animate-css tailwindcss-react-aria-components class-variance-authority lucide-react clsx tailwind-merge motion

Add cn helper using clsx and twMerge for conditional class merging in Tailwind components.

lib/utils.ts

Copy and paste the following code into your project.

components/ui/core/shortcut.tsx
npx @libravelui@latest add shortcut

Anatomy

import { Shortcut } from "@/components/ui/core/shortcut";
<Shortcut keys="Ctrl+S" />
<Shortcut keys={["Ctrl", "Alt", "Delete"]} />
<Shortcut>⌘ + C</Shortcut>

Props

Loading types…