{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "horizontal-rule-docs",
  "title": "Horizontal Rule",
  "description": "Void divider blocks rendered as horizontal rules.",
  "files": [
    {
      "path": "../../content/docs/(plugins)/(elements)/horizontal-rule.mdx",
      "content": "---\ntitle: Horizontal Rule\ndescription: Void divider blocks rendered as horizontal rules.\ndocs:\n  - route: /docs/components/hr-node\n    title: Horizontal Rule Element\n  - route: /docs/basic-blocks\n    title: Basic Blocks\n  - route: https://pro.platejs.org/docs/components/hr-node\n    title: Plus\n---\n\nHorizontal Rule adds a void `hr` block for separating sections. The package owns the element type, HTML parser, default `<hr>` render tag, and Markdown-style input rules. The registry kit adds the Plate UI divider component, static renderer, and insert toolbar item.\n\n<ComponentPreview name=\"basic-blocks-demo\" />\n\n<PackageInfo>\n\n## Features\n\n- Void block `hr` element.\n- HTML deserialization from `<hr>`.\n- Default render tag of `<hr>`.\n- `---` and `___ ` input rules through `HorizontalRuleRules.markdown()`.\n- Editable and static registry divider components.\n- Insert toolbar item labeled `Divider`.\n\n</PackageInfo>\n\n## Fast Path\n\n<Steps>\n\n### Add Basic Blocks\n\n`BasicBlocksKit` installs `HorizontalRulePlugin` with the registry `HrElement` and both default input rules.\n\n<ComponentSource name=\"basic-blocks-kit\" />\n\n```tsx\nimport { createPlateEditor } from 'platejs/react';\n\nimport { BasicBlocksKit } from '@/components/editor/plugins/basic-blocks-kit';\n\nexport const editor = createPlateEditor({\n  plugins: BasicBlocksKit,\n});\n```\n\n### Render The Divider\n\n`hr-node` renders the editable divider with selected/focused ring styles and a static companion component.\n\n<ComponentSource name=\"hr-node\" />\n\n### Add Static Rendering\n\nUse `BaseBasicBlocksKit` when rendering read-only content with `platejs/static`.\n\n<ComponentSource name=\"basic-blocks-base-kit\" />\n\n</Steps>\n\n## Ownership\n\n| Layer | Owner | What It Does |\n|-------|-------|--------------|\n| `@platejs/basic-nodes` | Package | Exports `BaseHorizontalRulePlugin` and `HorizontalRuleRules`. |\n| `@platejs/basic-nodes/react` | Package | Exports `HorizontalRulePlugin`. |\n| `basic-blocks-kit` | Registry | Adds `HorizontalRulePlugin` with dash and underscore input rules plus `HrElement`. |\n| `basic-blocks-base-kit` | Registry | Adds `BaseHorizontalRulePlugin.withComponent(HrElementStatic)`. |\n| `hr-node` | Registry UI | Renders editable and static divider components. |\n| Insert toolbar | Registry UI | Inserts `KEYS.hr` through the generic `insertBlock` path. |\n\nThere is no package-specific `insertHorizontalRule` helper. App UI usually inserts `KEYS.hr` through the same block insertion helper used by other registry blocks.\n\n## Manual Setup\n\n<Steps>\n\n### Install Package\n\n```bash\nnpm install @platejs/basic-nodes\n```\n\n### Add The Plugin\n\nUse the React plugin when the editor renders the divider UI.\n\n```tsx\nimport { HorizontalRuleRules } from '@platejs/basic-nodes';\nimport { HorizontalRulePlugin } from '@platejs/basic-nodes/react';\nimport { createPlateEditor } from 'platejs/react';\n\nimport { HrElement } from '@/components/ui/hr-node';\n\nexport const editor = createPlateEditor({\n  plugins: [\n    HorizontalRulePlugin.configure({\n      inputRules: [\n        HorizontalRuleRules.markdown({ variant: '-' }),\n        HorizontalRuleRules.markdown({ variant: '_' }),\n      ],\n      node: { component: HrElement },\n    }),\n  ],\n});\n```\n\n### Add Static Rendering\n\nUse the base plugin with the static component in static rendering paths.\n\n```tsx\nimport { BaseHorizontalRulePlugin } from '@platejs/basic-nodes';\nimport { createStaticEditor } from 'platejs';\n\nimport { HrElementStatic } from '@/components/ui/hr-node-static';\n\nexport const staticEditor = createStaticEditor({\n  plugins: [BaseHorizontalRulePlugin.withComponent(HrElementStatic)],\n});\n```\n\n</Steps>\n\n## Value Shape\n\nHorizontal rules are void block elements. Keep the empty text child so the node remains a valid Slate element.\n\n```tsx\nconst value = [\n  {\n    children: [{ text: 'Before the divider' }],\n    type: 'p',\n  },\n  {\n    children: [{ text: '' }],\n    type: 'hr',\n  },\n  {\n    children: [{ text: 'After the divider' }],\n    type: 'p',\n  },\n];\n```\n\n| Field | Type | Notes |\n|-------|------|-------|\n| `type` | `'hr'` | Plugin key and node type from `KEYS.hr`. |\n| `children` | `[{ text: '' }]` | Required child for the void element. |\n\n## Input Rules\n\n`HorizontalRuleRules.markdown()` converts a paragraph into an `hr` block and inserts an empty paragraph after it.\n\n| Rule | Trigger | Behavior |\n|------|---------|----------|\n| `HorizontalRuleRules.markdown({ variant: '-' })` | type the third `-` after `--` | Converts `---` to `hr`, then inserts a paragraph. |\n| `HorizontalRuleRules.markdown({ variant: '_' })` | type a space after `___` | Converts `___ ` to `hr`, then inserts a paragraph. |\n\nThe rule uses `editor.tf.setNodes({ type: KEYS.hr })`, so it transforms the current block instead of inserting a second divider elsewhere.\n\n## Registry UI\n\n| Surface | Behavior |\n|---------|----------|\n| Editable element | Renders a non-editable padded wrapper with an `<hr>` inside it. |\n| Selected + focused | Adds a focus ring around the divider. |\n| Read-only | Removes the pointer cursor from the editable component. |\n| Static element | Renders the same divider inside `SlateElement`. |\n| Insert toolbar | Adds a `Divider` item with `MinusIcon` and `KEYS.hr`. |\n\nThe divider component renders `{props.children}` after the non-editable wrapper so Slate can still keep the void child mounted.\n\n## API Reference\n\n| API | Package | Use |\n|-----|---------|-----|\n| `BaseHorizontalRulePlugin` | `@platejs/basic-nodes` | Headless void `hr` block with HTML deserialization and default render tag. |\n| `HorizontalRulePlugin` | `@platejs/basic-nodes/react` | React horizontal rule plugin. |\n| `HorizontalRuleRules.markdown({ variant: '-' })` | `@platejs/basic-nodes` | Creates the dash input rule for `---`. |\n| `HorizontalRuleRules.markdown({ variant: '_' })` | `@platejs/basic-nodes` | Creates the underscore input rule for `___ `. |\n",
      "type": "registry:file",
      "target": "content/docs/plate/(plugins)/(elements)/horizontal-rule.mdx"
    }
  ],
  "type": "registry:file"
}