For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
0
Sponsor

Kbd

Used to display textual user input from keyboard.

K
Ctrl+B
import { Kbd, KbdGroup } from "@/components/kbd/kbd";

export function KbdDemo() {
  return (
    <div
      style={{

Installation

$ pnpm dlx shadcn@latest add https://shadcn-cssinjs.vercel.app/r/kbd.json

Usage

import { Kbd, KbdGroup } from "@/components/ui/kbd/kbd";
<KbdGroup>
  <Kbd>⌘</Kbd>
  <Kbd>K</Kbd>
</KbdGroup>

Composition

Use the following composition to build a Kbd:

KbdGroup
├── Kbd
└── Kbd

Examples

Group

Use KbdGroup to display a key combination inline with text.

Press
ShiftP
to open the command palette.
import { Kbd, KbdGroup } from "@/components/kbd/kbd";

export function KbdGroupExample() {
  return (
    <div
      style={{

RTL

To enable right-to-left support, see the RTL guide.

Ctrl+B
"use client";

import * as React from "react";

import { useTranslation } from "@/components/language-selector";
import type { Translations } from "@/components/language-selector";

API Reference

Kbd

Use the Kbd component to display a keyboard key.

PropTypeDefault
classNamestring-

KbdGroup

Use the KbdGroup component to group Kbd components together.

PropTypeDefault
classNamestring-