Components/Feedback/Kbd
COMPONENT54.54

Kbd

Key-cap chip in muted surface with a machined bottom edge. Compose groups and input shortcuts freely.


INSTALL

1pnpm dlx @sayagodev/mo add kbd

Or import the files from the package (no copy):

1import "@sayagodev/mo/css/kbd.css";

EXAMPLES

In a button & input
In a menu

View
Group

Use Ctrl + BCtrl + K to open the command palette

Input group
K
⌘P
Tooltip

Hover a button: the tooltip names the action, the key cap shows its shortcut.

USAGE

1Press <kbd></kbd> <kbd>K</kbd>2 3<button class="outline">4  Save <kbd>S</kbd>5</button>

API

NAMEKINDDESCRIPTION
kbdelementAuto-styled key cap
.hstack.gap-*classGroup keys like shadcn KbdGroup
[data-shortcut]attributeRight-aligned shortcut inside dropdown items

FILES

src/css/kbd.css
Install:mo add kbd

THEMING · PLAYGROUND

This is the exact component from the examples above, wearing a completely different theme. Edit the tokens and --mo-* hooks in the editor — autocomplete knows them all — and the preview obeys in real time. Your CSS always wins.

Tokens & hooks — edit live
Global tokens
--border--muted--muted-foreground--radius

Preview

Your CSS

Try it: type --mo- for the component hooks, or edit any value — the preview obeys in real time.