Kbd
Keyboard key indicator rendered as an inline kbd element with terminal styling.
size="sm" renders 10px type — a dense desktop-legend size. On mobile/touch
surfaces keep the default size="md".
Installation
dgadd is not public on npm yet. Until the first release, pack @diffgazer/add from the repository and install that tarball into this app, which is what puts dgadd on pnpm exec.
The hosted registry is not public yet because r.b4r7.dev does not resolve. Use this source checkout or a local registry preview until the endpoint returns 200.
Diffgazer packages are not yet published to npm. Until the first release, pack @diffgazer/ui and @diffgazer/keys from the repository and install those tarballs.
UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS once packages are available.
Usage
Examples
Sizes
Inline
Group
API Reference
Kbd
KbdGroup
Accessibility
Notes
Size Variants
Available in sm and md sizes (defaults to md). Renders inline, designed for use inside text.
Terminal Styling
Rendered with a hairline border and a translucent --foreground fill so the key cap carries the same inline weight in light and dark palettes.
Inverse surfaces
Use `variant="inverse"` for caps on a bar painted in --foreground (shortcut legends, app footers). It mirrors the same border/fill recipe against --background, so the cap keeps its weight instead of disappearing into the inverted bar.
Chord Grammar
Two grammars are supported and should not be mixed on one surface: platform chords place modifier glyphs adjacent with no separator (Command K), spelled-out chords use a dimmed + between caps (Ctrl + Shift + P). Wrap either in KbdGroup and give the group an aria-label so assistive tech announces the whole shortcut.
Source
Install via CLI: pnpm exec dgadd add ui/kbd.
Highlighted source loads after this disclosure opens. Browse the source repository.