DocsComponentsTemplatesThemesGitHub

Kbd

Keycap for keyboard shortcuts.

Code

import * as React from 'react';
import { Kbd } from '@fruit-labs/design';

export default function Demo() {
  return (
    <div
      style={{
        display: 'flex',
        gap: 6,
        alignItems: 'center',
        color: 'var(--label-2)',
        fontSize: 14,
      }}
    >
      <Kbd>⌘</Kbd>
      <Kbd>K</Kbd>
      {' Open command menu'}
    </div>
  );
}

Install

From npm:

npm install @fruit-labs/design

import { Kbd } from '@fruit-labs/design';

Or copy the TypeScript source into your project:

npx shadcn@latest add https://design.fruitlabs.online/r/kbd.json

Guidelines

  • One key per Kbd: ⌘ K, not ⌘K.

Props

PropTypeRequired
classNamestringNo
childrenReact.ReactNodeNo

Edit this example on GitHub