Kbd

A keyboard key cap for showing shortcuts, with a raised edge and room for icons, plus a KbdGroup wrapper for combos like Cmd K. Renders a semantic kbd element.

src/registry/ui/kbd.tsx/r/kbd.json
⌘K

Combo

Installation#

bash
npx shadcn@latest add @minidev/kbd

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/kbd.json

Usage#

tsx
import { Kbd } from "@/components/ui/kbd"

export function Example() {
  return (
    <Kbd>⌘</Kbd>
  )
}

API reference#

Also accepts every prop of <kbd>, passed through to the root element.

Examples#

All Developer tool UI components for React

Learn more