# Kbd

> Keys and platform-aware shortcuts: mod+k reads ⌘K on a Mac and Ctrl K elsewhere, spoken as words.

- Tier: free, MIT
- Category: Data display
- Docs: https://ui.mlola.com/docs/components/kbd

## Install

```bash
npx mlola-ui add kbd
```

```tsx
import { Kbd } from "@/components/ui/kbd";
```

## Example

```tsx
import { Kbd, Shortcut } from "@/components/ui/kbd";

export default function Example() {
  return (
    <p>
      Press <Shortcut keys="mod+k" /> to search, or <Kbd>Esc</Kbd> to close.
    </p>
  );
}
```

## The same markup without React

```html
<p>Press <kbd class="ml-shortcut"><kbd class="ml-kbd" aria-hidden="true">⌘</kbd><kbd class="ml-kbd" aria-hidden="true">K</kbd><span class="ml-visually-hidden">Command K</span></kbd> to search, or <kbd class="ml-kbd">Esc</kbd> to close.</p>
```
