The Element SDK is in beta and not yet publicly released — APIs may change without notice.
The PluginManifest format and loadElementFromManifest for dynamic element registration
Element SDK plugins are ES modules that export an ElementDefinition produced by defineElement. A plugin ships alongside a manifest — a JSON file that describes its identity, its Chalk element schema, and where the code lives. At runtime, a host loads the manifest and calls loadElementFromManifest to validate, import, and register the element.
The runtime cannot distinguish a loaded plugin from a built-in element. Once registered, plugins render through the same ElementRenderer path as every other element.
A plugin module default-exports an ElementDefinition:
The kind in the definition must match the chalk.element field in the manifest. loadElementFromManifest enforces this — it overwrites the definition's kind with the manifest value to prevent mismatches.
id (string; required) — Unique plugin identifier, e.g. 'particle-sim'.name (string; required) — Human-readable display name.version (string; required) — Semver string, e.g. '1.0.0'.chalk.element (string; required) — The Chalk identifier this plugin registers — must be unique across all registered elements.chalk.attributes (object; optional) — Human-facing attribute schema used by the Chalk parser for validation.runtime ('module' | 'worker'; optional; default: 'module') — 'module' is a trusted ES module. 'worker' is reserved for future sandboxed execution and not yet implemented.src (string; required for module runtime) — URL or path to the ES module that default-exports the element definition.Validates the manifest, dynamically imports the plugin module from manifest.src, and registers the definition in the ElementRegistry.
importModule — Override the module loader. Defaults to native dynamic import(). Use this to enforce allow-lists, validate integrity hashes, or inject a mock in tests:
register — Set to false to load the definition without registering it. The definition is returned from the function so you can inspect it or register it manually:
Validate a manifest object independently of loading. Throws with a descriptive message on the first problem found:
Useful for validating a manifest before displaying it in a plugin marketplace UI, or for build-time checks.
After loading, definitions live in ElementRegistry — the same map that built-ins register into at startup.
Later registrations for the same kind silently override earlier ones. This lets you update a plugin without reloading the page.
Fetch and load plugins concurrently with Promise.all:
Dynamic import() executes arbitrary code from the src URL. Only load plugins from sources you trust. Use the importModule option to add an allow-list or integrity check before loading from user-supplied URLs.