canvasElement
functionDeclare a new kind of element the user can place on a document canvas. Renderer-native, like `editorExtension`. The module runs in the host's own renderer and shares its `lexical` and `react` instances through a live handle rather than over RPC, so the element is a real part of the canvas rather than an embedded webview. That is the line between this and `view`/`widget`, which are sandboxed and have no Node access. The `module` must default-export a `defineCanvasElement({...})` value, and its `schema.tag` has to match the `tag` you pass here. The loader compares the two by name and refuses to register the element if they differ. Use `canvasElement` to introduce a tag. Use canvasTemplate to offer a preset of a tag that already exists.
Import
import { canvasElement } from '@modular/sdk';Notes
- category
- Authoring