Skip to content
Dice UI

Kbd

A keyboard key primitive for displaying keyboard shortcuts and key combinations.

Deprecated. Kbd was removed from Dice UI in October 2025. shadcn/ui ships a Kbd component, so use that instead:

pnpm dlx shadcn@latest add kbd

Migrating

@diceui/kbd no longer installs. Replace it with shadcn/ui's Kbd and KbdGroup:

Dice UIshadcn/ui
Kbd.Root / KbdRootKbdGroup
Kbd.Key / KbdKeyKbd
Kbd.Separator / KbdSeparatorText between keys, such as +, or nothing
title on Kbd.KeyWrap the key in <abbr title="…">
variant and size on Kbd.RootclassName
import * as Kbd from "@/components/ui/kbd"; 
import { Kbd, KbdGroup } from "@/components/ui/kbd"; 
 
// Before
<Kbd.Root>
  <Kbd.Key>⌘</Kbd.Key>
  <Kbd.Separator />
  <Kbd.Key>K</Kbd.Key>
</Kbd.Root>
 
// After
<KbdGroup>
  <Kbd>
    <abbr title="Command">⌘</abbr>
  </Kbd>
  <Kbd>K</Kbd>
</KbdGroup>

Kbd.Key added a title for common symbols such as ⌘, ⇧ and ⌥ automatically. shadcn/ui's Kbd doesn't, so add an <abbr title> where a symbol needs a description.

On this page