Kbd: HextaUI and shadcn/ui

The HextaUI Kbd keeps the shadcn/ui names and theme tokens and installs with the same CLI. This page lists what differs, read from the source of both. The shadcn/ui side is its base-vega registry as of 2026-10-16.

At a glance

MeasureHextaUIshadcn/ui
Exported parts22
Props the wrapper handles110
Lines of source19526
npm dependencies@base-ui/react@^1.8.0class-variance-authoritycncn
Built fromhotkeythemeuse-held-keys–

More source is not better on its own. Most of the extra lines in HextaUI handle states, motion and edge cases that you would otherwise write yourself.

Props HextaUI adds

Props the HextaUI wrapper handles itself that the shadcn/ui wrapper does not. Props passed straight through to Base UI or the underlying library are left out, because both versions accept them.

PropWhat it does
listenKbdPress the cap while its real key is held. Works with keys or a plain key name as children.
variantKbdGroupPassed to every cap inside.
sizeKbdGroupPassed to every cap inside.
listenKbdGroupPassed to every cap inside.
separatorKbdGroupShown between the steps of a sequence.

Variants

PropIn bothOnly HextaUIOnly shadcn/ui
variantKbd–keycapflat–
sizeKbd–smdefaultlg–

The HextaUI version

ShiftCommandP

Press Command K to search, or hold Shift and watch the keys.

import { Kbd, KbdGroup } from "@/components/ui/kbd"

export function KbdDemo() {
  return (
    <div className="flex flex-col items-center gap-6 text-sm text-muted-foreground">
      <KbdGroup keys="mod+shift+p" size="lg" listen />
      <p>
        Press <Kbd keys="mod+k" listen /> to search, or hold{" "}
        <Kbd keys="shift" listen /> and watch the keys.
      </p>
    </div>
  )
}

Every state, the keyboard map and the API reference are on the component page.

7 of its examples also have a page of their own.

Switch one component

Run the add command with --overwrite to replace the shadcn/ui file in @/components/ui, then review the diff in git before you keep it. Imports stay the same, and components you don’t replace keep working.

pnpm dlx shadcn@latest add https://hextaui.com/r/kbd.json --overwrite
  • Every prop in the table above is an addition, so call sites written for shadcn/ui don’t pass it yet.
  • Check any part or variant listed only for shadcn/ui before you switch, and map it to the closest HextaUI one.

Other components compared

More comparisons