Components
Basic shortcut⌘K
Multiple keys⌘⇧S
With descriptions
⊞L⌥⌫
Different sizes
⌘P⌘P⌘P
Installation
CLI
Manual
Install the following dependencies:
Copy and paste the following code into your project.
Layout
Import the parts, and compose them together.
Built-in Key Titles
The component includes built-in titles for common keyboard symbols:
Custom Key Titles
You can provide custom titles for any key:
Examples
With Multiple Keys
IDE shortcuts
⌘⇧F⌘⌥↓
System shortcuts
⌘⌥⎋⌘⇧⌥P
Browser shortcuts
⌘⇧N⌘⌥I
With descriptions
⌃⌥⌫⌘⇧?
With Variants
Default⌘K
Outline⎋Esc
Ghost⌤Enter
Function keys
F1F5F11
Mixed variants
⌘⇧F⌥.
API Reference
Root
The main container component for keyboard shortcuts.
Prop | Type | Default |
---|---|---|
size | "default" | "sm" | "lg" | "default" |
variant | "default" | "outline" | "ghost" | "default" |
asChild | boolean | false |
Data Attribute | Value |
---|---|
[data-slot] | "kbd" |
Key
The component that represents a single keyboard key.
Prop | Type | Default |
---|---|---|
title | string | - |
asChild | boolean | false |
Data Attribute | Value |
---|---|
[data-slot] | "kbd-key" |
Separator
The component that represents the separator between keyboard keys.
Prop | Type | Default |
---|---|---|
asChild | boolean | false |
Data Attribute | Value |
---|---|
[data-slot] | "kbd-separator" |