Inline shortcut hint in body text
A common pattern is a sentence that ends with a chord — "Press ⌘K to open the search dialog." The Kbd Group nests inside a <p> tag with surrounding text on either side, separated by {' '} JSX whitespace tokens so the spaces survive Prettier. The Kbd sits at h-5 and align-items: center from the inline-flex on the Group, which puts the key centered on the text baseline of the paragraph.
The inline pattern is the most common shortcut hint in product UIs — settings pages, onboarding tooltips, empty states. Pair it with the Tooltip component for a hover hint, or with the Toast component for a transient confirmation that includes a shortcut to undo. The Kbd reads as part of the sentence because the font-mono family contrasts cleanly with the font-sans body text without breaking the line height.
1 import { Kbd } from "@/components/ui/kbd" 2 import { Command } from "lucide-react" 3 4 export default function Page() { 5 return ( 6 <p className="text-sm text-muted-foreground"> 7 Press{" "} 8 <Kbd.Group> 9 <Kbd><Command /></Kbd> 10 <Kbd>K</Kbd> 11 </Kbd.Group> 12 {" "}to open the search dialog. 13 </p> 14 ) 15 }

