1 GitHub star = 1 new component.

Star the repo
Typographytypographyutilitykeyboard

KBD Key Cap

Keyboard shortcut badge with 3D keycap style.

Live Preview

KBD Key Cap

Usage

Copy and paste this code into your React component:

tsx
import { KbdIndicator } from 'react-component-kit-ui/typography';

<KbdIndicator>Content</KbdIndicator>

Manual Installation

If you are not using the npm package, create a new file and paste the following code: src/components/KbdIndicator.tsx + KbdIndicator.css:

KbdIndicator.tsx
'use client';

import type { ReactNode } from 'react';
import './KbdIndicator.css';

/** KbdIndicator โ€” ported from astro-component-kit. */
export interface KbdIndicatorProps {
  children?: ReactNode;
}

export function KbdIndicator({ children }: KbdIndicatorProps) {
  return (
    <>
      <kbd className="tau-kbd" data-rk-ca0051="">{children}</kbd>
    </>
  );
}

export default KbdIndicator;
KbdIndicator.css
/* KbdIndicator โ€” ported from astro-component-kit (typography/KbdIndicator.astro) */

.tau-kbd:where([data-rk-ca0051]) { background: #1e293b; border: 1px solid #334155; border-bottom-width: 3px; border-radius: 6px; padding: 2px 8px; color: #f1f5f9; font-family: sans-serif; font-weight: 700; font-size: 0.75rem; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; box-shadow: 0 2px 0 rgba(0,0,0,0.4); vertical-align: middle; }

Quick Info

Category
Typography
Filename
KbdIndicator.tsx
Dependencies
None โ€” pure React + CSS
Tags
typographyutilitykeyboard