Component

Kbd

A small keyboard hint primitive for command surfaces and docs.

Preview

CtrlKEsc

Installation

Install the package, then import the component and shared stylesheet in your app.

Package install

Install the package when you want components imported from axie-ui.

install
pnpm add axie-ui

Import

code
import "axie-ui/styles.css";import { Kbd } from "axie-ui";

Registry install

Use the direct URL when you want shadcn to copy editable source into your app. This works without the official registry and does not install axie-ui.

registry
pnpm dlx shadcn@latest add https://axie.alexi.life/r/kbd.json

Copied source import

code
import "@/styles/axie.css";import { Kbd } from "@/components/axie/kbd";

Prefer @axie/kbd? Add the Axie namespace once from the Installation page, then use that shorthand.

Usage

code
import { Kbd } from "axie-ui";export function Example() {  return <Kbd>Ctrl K</Kbd>;}

Accessibility

  • Use keyboard hints as supporting text only.
  • Prefer platform-aware shortcut labels where possible.
  • Do not hide primary actions behind shortcuts.

API Reference

PropTypeDefaultDescription
childrenReactNode-Keyboard key label.
...propsHTMLAttributes<HTMLElement>-Native kbd props.