Components
Keyboard Input
Used to display textual user input from the keyboard. Use it for shortcut hints and key references -- not for general inline code.
Toolkit API. Kbd and KbdGroup match @distylai/toolkit-ui, built on the semantic <kbd> element. Inside a tooltip, a key cap switches to a translucent surface automatically.
Preview
Rendered with live Folio tokens -- the muted surface and text remap on theme change, no dark: classes.
Examples
Press Esc to close
In a sentenceA single key uses Kbd; a sequence wraps them in KbdGroup for even spacing. Each key is at least square (min-w-5) so K and Esc sit consistently.
API
Don't and Do
Don't use Kbd for inline code, file names, or values -- that's a <code>. Reserve it for actual keystrokes.
<KbdGroup>
<Kbd>⌘</Kbd>
<Kbd>K</Kbd>
</KbdGroup>import { Kbd, KbdGroup } from "@/components/shadcn/kbd";
export function CommandHint() {
return (
<KbdGroup>
<Kbd>⌘</Kbd>
<Kbd>K</Kbd>
</KbdGroup>
);
}Drop-in ready. Renders a real <kbd> element, so it's semantic and screen-reader friendly.