Passive keyboard labels using Minecraft button artwork.
Preview
Example source could not be loaded: kbd-example. Reload this page to retry.Usage
Kbd renders a kbd element and KbdGroup a span. These passive labels have no activation or keyboard shortcut handler. Scale defaults to 2; intrinsic width follows measured text and Unicode glyph loading. Register the actual shortcut in your application and describe its scope separately.
Composition
Compose one Kbd per key inside KbdGroup and label a chord if its reading order is ambiguous. The button surface is visual reuse, not button semantics, click audio or native hotkey registration.
Installation
Component source
This is the component implementation. Its supporting styles, helpers and resources are also required. See complete manual installation.
"use client";
import * as React from "react";
import { minecraftGlyphs } from "./minecraft-font";
import {
isMinecraftTextContent,
minecraftClasses as cn,
minecraftStyle,
} from "./minecraft-render";
import { MinecraftUnicodeLabel } from "./minecraft-unicode-label";
Interactive playground
JUMP
SHORTCUT
UNAVAILABLE
Keyboard labels display shortcuts