Kbd

Inline keyboard hint, styled to look like a physical key cap. KbdGroup chains multiple together for sequences like ⌘ K.

Default

Single key cap.

Dark previewReplay previewOpen in new tab

Press ? to view all shortcuts.

Usage

Import the parts you need from the component's folder.

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

Group

Chain modifiers with KbdGroup.

Dark previewReplay previewOpen in new tab

Open command palette:

Inside a button

A Kbd or KbdGroup trailing the label turns a button into a command-menu trigger.

Dark previewReplay previewOpen in new tab

Inside a tooltip

Show the shortcut for an action alongside its label in the tooltip.

Dark previewReplay previewOpen in new tab

Input group addon

A Kbd addon hints the shortcut that focuses a search or command field.

Dark previewReplay previewOpen in new tab
Press/

API Reference

Kbd / KbdGroup

PropTypeDefaultDescription
classstring—Override typography or shape.