feat(node): add as property to allow custom HTML elements

This commit is contained in:
Abbey Yacoe
2025-05-22 15:04:20 +02:00
parent 74929f09bc
commit 21e25d698c
5 changed files with 47 additions and 29 deletions
+4
View File
@@ -23,6 +23,10 @@ export type NodeBase<
data: NodeData;
/** Type of node defined in `nodeTypes`. */
type?: NodeType;
/** Custom element type for rendering the node (e.g., 'div', 'li', etc.).
* @default 'div'
*/
as?: Extract<keyof HTMLElementTagNameMap, 'div' | 'li' | 'ul' | 'ol'>;
/**
* Only relevant for default, source, target nodeType. Controls source position.
* @example 'right', 'left', 'top', 'bottom'