Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Shadcn Kbd for React and Tailwind

Styled representation of a single key.

K
+K

Installation

bunx --bun shadcn@latest add https://kit.dev/r/kbd.json

Usage

import { Kbd, KbdGroup } from "@/components/ui/kbd";
<div className="flex flex-col items-center gap-4">
  <div className="flex gap-2">
    <Kbd>K</Kbd>
    <Kbd>⌘</Kbd>
    <Kbd>⌃</Kbd>
    <Kbd>⇧</Kbd>
  </div>
  <div className="flex gap-2">
    <KbdGroup>
      <Kbd>⌘</Kbd>
      <span>+</span>
      <Kbd>K</Kbd>
    </KbdGroup>
  </div>
</div>

Demos

Button

Input Group

Kbd Group

Tooltip

Variant Outline

API Reference

Kbd

kbd

PropType
AttributeType

KbdGroup

div

PropType
AttributeType