Kbd

Utilities

A component for displaying keyboard keys and shortcuts. Use Kbd to show keyboard interactions, hotkeys, or command shortcuts in your documentation.

Import

import { Kbd, KeyboardShortcut } from "@/components/ui/kbd";

Usage

Single Keys

Individual keyboard keys

EnterEscTabSpaceBackspace

Key Combinations

Multiple keys for shortcuts

KSP

With Labels

Shortcuts with descriptive labels

SearchKSaveSCommand PalettePClose

Sizes

Different key sizes

SmMdLg

Common Shortcuts

Pre-defined keyboard shortcuts

CopyC
PasteV
UndoZ
RedoZ

API Reference

PropTypeDefaultDescription
keysstring | string[]Key(s) to display
variant"default" | "outline" | "flat""default"Visual style
size"sm" | "md" | "lg""md"Size of the key

Related Components