npx shadcn@latest add https://sdk-components.thesqd.com/r/kbd.jsonimport { Kbd } from "@/components/ui/kbd";import { Kbd } from "@/components/ui/kbd";
export function Example() {
return <Kbd keys={["cmd", "k"]} />;
}Kbd (single component — pass everything as props)
├── keys={["cmd","k"]} (platform-aware combo; ⌘ on mac, Ctrl on windows)
├── separator="+" (drawn between keys; default "+")
├── platform="auto | mac | windows"
├── size="sm | md | lg" (default "sm")
├── variant="default | primary | secondary | outline | ghost | danger"
├── pressed (pressed-in look)
├── disabled
└── children (a single key, when not using `keys`)| Prop | Type | Default | Description |
|---|---|---|---|
keys | string[] | — | Render a combo from named keys (e.g. `["cmd","k"]`). Modifier names resolve to platform symbols; anything unknown renders verbatim. |
separator | string | "+" | Drawn between keys when using `keys`. |
platform | "auto" | "mac" | "windows" | "auto" | Key symbol set. `auto` detects the OS client-side (⌘/⌥/⌃ on mac, Ctrl/Alt on windows). |
size | "sm" | "md" | "lg" | "sm" | Key cap size. |
variant | "default" | "primary" | "secondary" | "outline" | "ghost" | "danger" | "default" | Visual tone of the key cap. |
pressed | boolean | false | Pressed-in look (nudged down, flattened shadow). |
disabled | boolean | false | Dim and mark the key as non-interactive. |
children | ReactNode | — | A single key/glyph, used when `keys` is not provided. |
className | string | — | Override or extend the resolved variant classes. |