{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "kbd-docs",
  "title": "Keyboard Input",
  "description": "Style keyboard shortcuts and key names.",
  "files": [
    {
      "path": "../../content/docs/(plugins)/(marks)/kbd.mdx",
      "content": "---\ntitle: Keyboard Input\ndescription: Style keyboard shortcuts and key names.\ndocs:\n  - route: /docs/basic-marks\n    title: Basic Marks\n  - route: /docs/components/kbd-node\n    title: Keyboard Input Leaf\n  - route: /docs/components/more-toolbar-button\n    title: More Toolbar Button\n---\n\nKeyboard Input applies the `kbd` leaf mark to selected text. Use it for shortcuts, key names, and command hints that should render as `<kbd>`.\n\n<ComponentPreview name=\"basic-marks-demo\" />\n\n<PackageInfo>\n\n## Features\n\n- `KEYS.kbd` leaf mark.\n- Hard selection affinity.\n- HTML deserialization from `kbd`.\n- `<kbd>` rendering by default.\n- Registry `KbdLeaf` for styled keyboard input.\n- Static rendering support through `KbdLeafStatic`.\n\n</PackageInfo>\n\n## Kit Usage\n\n<Steps>\n\n### Add Basic Marks\n\n`BasicMarksKit` includes `KbdPlugin.withComponent(KbdLeaf)`. It does not add a shortcut or input rule for keyboard input.\n\n<ComponentSource name=\"basic-marks-kit\" />\n\n```tsx\nimport { createPlateEditor } from 'platejs/react';\n\nimport { BasicMarksKit } from '@/components/editor/plugins/basic-marks-kit';\n\nexport const editor = createPlateEditor({\n  plugins: [...BasicMarksKit],\n});\n```\n\n### Add the Leaf\n\n`KbdLeaf` provides the registry styling for the `<kbd>` element.\n\n<ComponentSource name=\"kbd-node\" />\n\n### Add a Toolbar Control\n\nThe registry `MoreToolbarButton` toggles keyboard input from the More menu.\n\n```tsx\nimport { MoreToolbarButton } from '@/components/ui/more-toolbar-button';\n\nexport function FormattingMoreMenu() {\n  return <MoreToolbarButton />;\n}\n```\n\n</Steps>\n\n## Manual Usage\n\nInstall the mark package.\n\n```bash\nnpm install @platejs/basic-nodes\n```\n\nAdd `KbdPlugin` directly when you want the default `<kbd>` render.\n\n```tsx\nimport { KbdPlugin } from '@platejs/basic-nodes/react';\nimport { createPlateEditor } from 'platejs/react';\n\nexport const editor = createPlateEditor({\n  plugins: [KbdPlugin],\n});\n```\n\nAttach the registry leaf when you want the same visual treatment as the kit.\n\n```tsx\nimport { KbdPlugin } from '@platejs/basic-nodes/react';\n\nimport { KbdLeaf } from '@/components/ui/kbd-node';\n\nexport const kbdPlugin = KbdPlugin.withComponent(KbdLeaf);\n```\n\n## Ownership\n\n| Surface | Owner | What It Does |\n|---------|-------|--------------|\n| `BaseKbdPlugin` | `@platejs/basic-nodes` | Headless keyboard-input mark, HTML parser, render tag, selection rule, and `toggle` transform. |\n| `KbdPlugin` | `@platejs/basic-nodes/react` | React wrapper for the headless keyboard-input mark. |\n| `KbdLeaf` | Registry UI | Styled client `<kbd>` leaf using `PlateLeaf`. |\n| `KbdLeafStatic` | Registry UI | Static rendering version using `SlateLeaf`. |\n| `BasicMarksKit` | Registry | Adds `KbdPlugin.withComponent(KbdLeaf)`. |\n| `MoreToolbarButton` | Registry UI | Calls `editor.tf.toggleMark(KEYS.kbd)` from the More menu. |\n\nThe package owns the mark. The registry owns keycap styling and toolbar placement.\n\n## Behavior\n\n| Behavior | Source |\n|----------|--------|\n| Mark key | `KEYS.kbd` |\n| Leaf behavior | `node.isLeaf: true` |\n| Toggle transform | `editor.tf.kbd.toggle()` calls `editor.tf.toggleMark(type)`. |\n| Selection affinity | `hard` |\n| HTML tags | `kbd` |\n| Render output | `kbd` |\n| Kit component | `KbdLeaf` |\n| Registry toolbar | `MoreToolbarButton` toggles `KEYS.kbd`. |\n\n## API Reference\n\n| API | Package | Use |\n|-----|---------|-----|\n| `BaseKbdPlugin` | `@platejs/basic-nodes` | Headless keyboard-input plugin. |\n| `KbdPlugin` | `@platejs/basic-nodes/react` | React keyboard-input plugin. |\n| `tf.kbd.toggle()` | `@platejs/basic-nodes` | Toggles the keyboard-input mark at the selection. |\n| `KbdLeaf` | Registry UI | Styled client keyboard-input leaf. |\n| `KbdLeafStatic` | Registry UI | Styled static keyboard-input leaf. |\n",
      "type": "registry:file",
      "target": "content/docs/plate/(plugins)/(marks)/kbd.mdx"
    }
  ],
  "type": "registry:file"
}