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.jsonGuidelines
- One key per Kbd: ⌘ K, not ⌘K.
Props
| Prop | Type | Required |
|---|---|---|
className | string | No |
children | React.ReactNode | No |