Skip to content
← Inventory

Kbd

Keyboard key indicator for displaying keyboard shortcuts.

K

Usage

import { Kbd, KBD_SIZE_CLASSES, KbdGroup, KbdGroupProps, KbdProps, kbdVariants } from "@desk/ui/components/kbd";

Best practices

  • Wrap multi-key chords in KbdGroup and set size on the group — children inherit it via context, so you size the combo once.

  • It renders a semantic <kbd>; reserve it for keyboard keys/shortcuts, not as a generic small-label chip (that's Badge).

Props

Kbd

PropTypeDefaultDescription
tone"neutral" | "brand" | "danger" | null | undefined
emphasis"outline" | "solid" | "ghost" | "soft" | null | undefined
sizeResponsiveSize"sm"

Kbd size — a single token or a per-breakpoint object like { base: "sm", md: "lg" }.

KbdGroup

PropTypeDefaultDescription
sizeResponsiveSize

Size to apply to all child Kbd components — a single token or a per-breakpoint object like { base: "sm", md: "lg" }.

Also exports

  • constKBD_SIZE_CLASSES
  • typeKbdGroupProps
  • typeKbdProps
  • constkbdVariants