# Keyboard (/text/keyboard)





<ComponentPreview name="keyboard-preskok-demo" description="Common shortcut badges." />

## Shortcuts [#shortcuts]

<ComponentPreview name="keyboard-shortcuts-preskok-demo" description="Handle platform-aware shortcuts with useKeyboard." />

`useKeyboard` accepts shortcut strings such as `Mod+s`, where `Mod` resolves to
Command on macOS and Control on other platforms. A shortcut handler prevents the
browser default and stops propagation unless it returns a different policy.

## Installation [#installation]

```bash
npx shadcn@latest add @preskok/keyboard
```

## Usage [#usage]

```tsx
import { Keyboard } from "@/components/ui/preskok-ui/keyboard"

export function Example() {
  return <Keyboard keys={["⌘", "K"]} />
}
```
