Used to display textual user input from keyboard.

Component kbd-demo not found in registry.

Installation

npx shadcn@latest add kbd

Usage

import { Kbd } from "@/components/ui/kbd"
<Kbd>Ctrl</Kbd>

Examples

Group

Use the KbdGroup component to group keyboard keys together.

Component kbd-group not found in registry.

Button

Use the Kbd component inside a Button component to display a keyboard key inside a button.

Component kbd-button not found in registry.

Tooltip

You can use the Kbd component inside a Tooltip component to display a tooltip with a keyboard key.

Component kbd-tooltip not found in registry.

Input Group

You can use the Kbd component inside a InputGroupAddon component to display a keyboard key inside an input group.

Component kbd-input-group not found in registry.

API Reference

Kbd

Use the Kbd component to display a keyboard key.

PropTypeDefault
classNamestring``
<Kbd>Ctrl</Kbd>

KbdGroup

Use the KbdGroup component to group Kbd components together.

PropTypeDefault
classNamestring``
<KbdGroup>
  <Kbd>Ctrl</Kbd>
  <Kbd>B</Kbd>
</KbdGroup>