Pho Design System

Kbd

A keyboard keycap for documenting a shortcut — ⌘K in a command menu, Esc in a dialog hint, to submit. Kbd is purely presentational: it renders a <kbd> and carries no interaction. To actually trigger a shortcut, wire a key handler on the target control.

Import

import { Kbd } from "@photon-ai/pho-ui/components/kbd";

Keys

Supply the key through children, or use the keys string convenience. Both render the same single cap.

KEsc
<Kbd>⌘</Kbd>
<Kbd>K</Kbd>
<Kbd keys="Esc" />
<Kbd keys="↵" />

Chords

There’s no multi-key prop by design — a chord is just several caps in a row, which lets you place literal text between them.

Press K to search
<span className="inline-flex items-center gap-1">
  Press <Kbd>⌘</Kbd>
  <Kbd>K</Kbd> to search
</span>

Props

Accessibility

Keyboard: none — Kbd is presentational and not focusable, so it never enters the tab order and has no interaction of its own.

Best practices