Kbd
Shows a keyboard key or shortcut. 24px tall with 16px text.
Installation
npx shadcn@latest add @sevenone/kbdUsage
import { Kbd, KbdGroup } from "@/components/ui/kbd"Examples
Keys and shortcut
⌘K
Press Ctrl + B to toggle the sidebar.
<KbdGroup>
<Kbd>⌘</Kbd>
<Kbd>K</Kbd>
</KbdGroup>Accessibility
- Uses the kbd element, so screen readers know it is a key.