# HeadingNode
Class Inherits TextNode
## About
`HeadingNode` is rich editable text with a semantic heading level from one through six. Its insertion toolbar menu permits choosing the level before insertion, and the hover insertion chooser inserts Heading 1, and its HTML output uses the corresponding heading element.
Heading nodes are registered by every editor automatically.
## Enumerations
| Name | Value | Description |
| --- | :---: | --- |
| Levels | Heading1 = 1 <br > Heading2 = 2 <br > Heading3 = 3 <br > Heading4 = 4 <br > Heading5 = 5 <br > Heading6 = 6 | (None) |
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| ActionItem | index As Integer | ToolbarItem | Returns the contextual toolbar item at the specified index. |
| Constructor | value As String = "" <br> level As Levels = Levels.Heading2 | (None) | Creates a new heading node instance initialized from the supplied values. |
| Duplicate | (None) | Node | Returns an independent copy of this node and its configurable state. |
| EditingRestoreState | state As Variant | (None) | Restores a previously captured editing state. |
| EditingState | (None) | Variant | Returns a snapshot that can restore the current editing state. |
| ExportStyles | stylesheet As GraffitiProEditor.Stylesheet | (None) | Adds the stylesheet rules this node type's HTML output uses. |
| FromHTML | element As GraffitiProEditor.HTMLSupport.HTMLElement | Boolean | Imports supported content and formatting from an HTML element and returns whether it succeeded. |
| HTMLTags | (None) | String | Returns the HTML tag names supported by this node type. |
| InspectorSections | (None) | InspectorSection | Returns the explicit inspector sections exposed by this node. |
| LastActionIndex | (None) | Integer | Returns the last zero-based action index supplied by this node, or -1 when there are no actions. |
| 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. |
| PerformAction | index As Integer <br> selectedItem As DesktopMenuItem | (None) | Handles the contextual toolbar action at the specified index. |
| PerformToolbarAction | editor As Editor <br> selectedItem As DesktopMenuItem | (None) | Handles activation of this node type's main-toolbar item. |
| ToHTML | (None) | String | Returns an HTML representation of this content. |
| 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 |
| --- | :---: | :---: | --- |
| Anchor | String | (None) | Returns the heading's anchor: its text in lowercase, with spaces as hyphens and punctuation removed, as GitHub makes heading links. HTML export uses it as the heading's id, and TableOfContentsNode links to it. |
| Level | Levels | (None) | Gets or sets the level. |
## Notes
Choose semantic level independently from direct typography.
### JSON Values
The heading level is stored in `content.headingLevel`. Values `1` through `6` correspond directly to `Heading1` through `Heading6`. Rich text and character styles use the `TextNode`, `TextSnapshot`, and `TextStyle` JSON formats.
### Typography and Level
Changing font size updates both rendering and measured height. `Level` controls document semantics and default presentation but remains independent from direct character styling. Use heading levels to represent hierarchy rather than merely obtaining a larger font.
## Examples
Heading nodes are available without explicit registration.
### Document Heading
```xojo
Editor.AddNode(New GraffitiProEditor.HeadingNode("Overview", GraffitiProEditor.HeadingNode.Levels.Heading2))
```