# DividerNode
Class Inherits Node
## About
`DividerNode` draws a horizontal rule across the content width to separate sections of a document. The line's thickness and color are configurable, and the node also supports the common node background, border, corner, and alignment settings.
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Constructor | (None) | (None) | Creates a new divider node with a one-point light gray line. |
| Duplicate | (None) | Node | Returns an independent copy of this node and its configurable state. |
| FromHTML | element As GraffitiProEditor.HTMLSupport.HTMLElement | Boolean | Imports a horizontal rule and its line appearance from an HTML element. |
| FromJSON | data As JSONItem | Boolean | Restores state from JSON data and returns whether it succeeded. |
| HTMLTags | (None) | String | Returns the HTML tag names supported by this node type. |
| InspectorSections | (None) | InspectorSection | Returns the divider properties exposed by the inspector. |
| LocalizeToolbarItem | strings As GraffitiProEditor.Editor | (None) | Sets this node type's toolbar item text from the supplied editor's localization properties. The editor calls it when the type is registered, when the editor opens, and when a locale pack is applied to the editor. A custom node type can override it to localize its own toolbar item. |
| PerformToolbarAction | editor As Editor <br> selectedItem As DesktopMenuItem | (None) | Handles activation of this node type's main-toolbar item. |
| PreferredHeight | g As Graphics <br> availableWidth As Double | Double | Returns the preferred node height for the available width. |
| Render | g As Graphics <br> bounds As Rect <br> selected As Boolean | (None) | Draws the node within the supplied document bounds. |
| ToHTML | (None) | String | Returns an HTML representation of this content. |
| ToJSON | (None) | JSONItem | Returns a JSON representation of this object's persistent state. |
| ToMarkdown | (None) | String | Returns a Markdown representation of this content. |
| TypeName | (None) | String | Returns the display name for this node type. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| LineColor | Color | (None) | Gets or sets the color of the divider line. |
| LineThickness | Double | (None) | Gets or sets the thickness of the divider line in points. |
## Notes
A divider has no editable text. Its height is the line thickness plus vertical padding, and the line is centered within it.
### HTML and Markdown
HTML export writes an `hr` whose line is drawn with `height` and `background-color`, after `border:none`, so browsers match the editor. HTML import reads those values, and also accepts the common `border-top` style from other sources as the line instead of a node border.
Markdown export writes `---` for the default 1-point light gray line without other appearance settings. Any other divider is written as its HTML, which Markdown import preserves. Markdown import turns `---`, `***`, and `___`, including spaced forms such as `* * *`, into dividers.
### JSON Format
`lineThickness` is the line height in points. `lineColor` is a color object with `red`, `green`, `blue`, and `alpha` values. The remaining fields use the common `Node` format.
`lineThickness` is omitted when it is `1` and `lineColor` when it is black with alpha `0`; missing names restore those defaults.
## Examples
Register a divider prototype before inserting, importing, or restoring dividers.
### Thick Divider
```xojo
Editor.NodeTypes.Add(New GraffitiProEditor.DividerNode)
Var divider As New GraffitiProEditor.DividerNode
divider.LineThickness = 3
divider.LineColor = Color.RGB(37, 99, 235)
Editor.AddNode(divider)
```