{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "strikethrough-docs",
  "title": "Strikethrough",
  "description": "Strike through inline text.",
  "files": [
    {
      "path": "../../content/docs/(plugins)/(marks)/strikethrough.mdx",
      "content": "---\ntitle: Strikethrough\ndescription: Strike through inline text.\ndocs:\n  - route: /docs/basic-marks\n    title: Basic Marks\n  - route: /docs/components/mark-toolbar-button\n    title: Mark Toolbar Button\n  - route: /docs/plugin-shortcuts\n    title: Plugin Shortcuts\n---\n\nStrikethrough applies the `strikethrough` leaf mark to selected text. The package owns the mark semantics; `BasicMarksKit` adds the Markdown-style input rule and shortcut.\n\n<ComponentPreview name=\"basic-marks-demo\" />\n\n<PackageInfo>\n\n## Features\n\n- `KEYS.strikethrough` leaf mark.\n- Directional selection affinity.\n- HTML deserialization from `s`, `del`, `strike`, and line-through text decoration.\n- `<s>` rendering by default.\n- Optional Markdown-style input rule through `StrikethroughRules`.\n- Toolbar support through `MarkToolbarButton`.\n\n</PackageInfo>\n\n## Kit Usage\n\n<Steps>\n\n### Add Basic Marks\n\n`BasicMarksKit` includes `StrikethroughPlugin`, `~~` input rules, and a `mod+shift+x` shortcut.\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 A Toolbar Button\n\nUse `MarkToolbarButton` with `KEYS.strikethrough`.\n\n```tsx\nimport { StrikethroughIcon } from 'lucide-react';\nimport { KEYS } from 'platejs';\n\nimport { MarkToolbarButton } from '@/components/ui/mark-toolbar-button';\n\nexport function StrikethroughToolbarButton() {\n  return (\n    <MarkToolbarButton\n      nodeType={KEYS.strikethrough}\n      tooltip=\"Strikethrough\"\n    >\n      <StrikethroughIcon />\n    </MarkToolbarButton>\n  );\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 `StrikethroughPlugin` directly when you want the default `<s>` render.\n\n```tsx\nimport { StrikethroughPlugin } from '@platejs/basic-nodes/react';\nimport { createPlateEditor } from 'platejs/react';\n\nexport const editor = createPlateEditor({\n  plugins: [StrikethroughPlugin],\n});\n```\n\nConfigure the input rule and shortcut when you want the same behavior as the kit.\n\n```tsx\nimport { StrikethroughRules } from '@platejs/basic-nodes';\nimport { StrikethroughPlugin } from '@platejs/basic-nodes/react';\n\nexport const strikethroughPlugin = StrikethroughPlugin.configure({\n  inputRules: [StrikethroughRules.markdown()],\n  shortcuts: { toggle: { keys: 'mod+shift+x' } },\n});\n```\n\n## Ownership\n\n| Surface | Owner | What It Does |\n|---------|-------|--------------|\n| `BaseStrikethroughPlugin` | `@platejs/basic-nodes` | Headless strikethrough mark, HTML parser, render tag, selection rule, and `toggle` transform. |\n| `StrikethroughPlugin` | `@platejs/basic-nodes/react` | React wrapper for the headless strikethrough mark. |\n| `StrikethroughRules.markdown` | `@platejs/basic-nodes` | Optional `~~` mark input rule factory. |\n| `BasicMarksKit` | Registry | Adds `StrikethroughPlugin`, the input rule, and `mod+shift+x`. |\n| `MarkToolbarButton` | Registry UI | Reads active mark state and calls the mark toggle hook. |\n\nThe package owns the mark. The registry owns shortcut configuration and toolbar placement.\n\n## Behavior\n\n| Behavior | Source |\n|----------|--------|\n| Mark key | `KEYS.strikethrough` |\n| Leaf behavior | `node.isLeaf: true` |\n| Toggle transform | `editor.tf.strikethrough.toggle()` calls `editor.tf.toggleMark(type)`. |\n| Selection affinity | `directional` |\n| HTML tags | `s`, `del`, `strike` |\n| HTML styles | `text-decoration: line-through` |\n| HTML guard | Ignores descendants where `textDecoration` is `none`. |\n| Render output | `s` |\n| Kit input rule | `StrikethroughRules.markdown()` |\n| Kit shortcut | `mod+shift+x` |\n\n## API Reference\n\n| API | Package | Use |\n|-----|---------|-----|\n| `BaseStrikethroughPlugin` | `@platejs/basic-nodes` | Headless strikethrough plugin. |\n| `StrikethroughPlugin` | `@platejs/basic-nodes/react` | React strikethrough plugin. |\n| `StrikethroughRules.markdown()` | `@platejs/basic-nodes` | Creates the `~~` mark input rule. |\n| `tf.strikethrough.toggle()` | `@platejs/basic-nodes` | Toggles the strikethrough mark at the selection. |\n",
      "type": "registry:file",
      "target": "content/docs/plate/(plugins)/(marks)/strikethrough.mdx"
    }
  ],
  "type": "registry:file"
}