✨ Working with PDFs, images or videos? Discover 145+ free web apps built for everyday tasks

Kbd

Keyboard key and shortcut display for commands, documentation, and inline hints.

Loading preview...

Examples

Practical examples and common states for the same installable component.

Shortcut

Combine multiple keys into a shortcut using the keys prop.

examples/kbd-shortcut.tsx
import { Kbd } from "@/components/wensity/kbd";
export function ShortcutKeys() {
return (
<div className="flex flex-wrap items-center gap-3">
<Kbd keys={["⌘", "K"]} />
<Kbd keys={["⌘", "Shift", "P"]} />
<Kbd keys={["Ctrl", "D"]} />
</div>
);
}

Inline

Embed keyboard hints inside paragraph text.

examples/kbd-inline.tsx
import { Kbd } from "@/components/wensity/kbd";
export function InlineKeys() {
return (
<div className="max-w-sm text-sm leading-relaxed">
<p className="mb-2">
Press <Kbd inline></Kbd><Kbd inline>J</Kbd> to toggle the terminal.
</p>
<p>
Hold <Kbd inline></Kbd> and click to add a new cursor.
</p>
</div>
);
}

Sequence

Show keys pressed in a specific order.

examples/kbd-sequence.tsx
import { Kbd } from "@/components/wensity/kbd";
export function KeySequence() {
return (
<Kbd.Sequence>
<Kbd></Kbd><Kbd>K</Kbd>
<span className="px-1 text-[11px] text-neutral-500">then</span>
<Kbd>G</Kbd>
</Kbd.Sequence>
);
}

Command

Application commands with labelled shortcuts.

examples/kbd-command.tsx
import { Kbd } from "@/components/wensity/kbd";
export function CommandList() {
return (
<div className="flex w-full max-w-xs flex-col gap-2">
<Kbd.Command keys={["⌘", "K"]}>Toggle Search</Kbd.Command>
<Kbd.Command keys={["⌘", "Shift", "P"]}>Command Palette</Kbd.Command>
<Kbd.Command keys={["⌘", "B"]}>Toggle Sidebar</Kbd.Command>
</div>
);
}