GitHub

Kbd

Displays keyboard input.

Loading
Loading...
import { Kbd, KbdGroup } from "@/components/ui/kbd";
 
export function KbdDemo() {
  return (
    <div className="flex flex-col items-center gap-4">
      <KbdGroup>
        <Kbd>⌘</Kbd>
        <Kbd>⇧</Kbd>
        <Kbd>⌥</Kbd>
        <Kbd>⌃</Kbd>
      </KbdGroup>
      <KbdGroup>
        <Kbd>Ctrl</Kbd>
        <span>+</span>
        <Kbd>B</Kbd>
      </KbdGroup>
    </div>
  );
}

Installation

npx shadcn@latest add "https://ui.blode.co/r/styles/default/kbd"

Usage

import { Kbd } from "@/components/ui/kbd";
<Kbd>{/* Example usage */}</Kbd>

Props

PropTypeDefaultDescription
classNamestring-The class name to apply to the component.
childrenReactNode-The content to display in the component.