Skip to content
CCinder
Cinder.registerDomAdapter

API Reference

Cinder.registerDomAdapter

Register a DOM adapter for custom controls or execution paths that are not covered well by standard browser behavior.

Use registerDomAdapter() when a custom widget cannot be handled reliably through standard DOM execution.

Example

ts
10 lines
Cinder.registerDomAdapter({
  id: 'custom-combobox',
  match(context) {
    return context.element.getAttribute('role') === 'combobox';
  },
  execute(context) {
    context.element.dispatchEvent(new Event('click', { bubbles: true }));
    return true;
  },
});

Adapter shape

ts
5 lines
{
  id: string;
  match(context): boolean;
  execute(context): boolean | Promise<boolean>;
}

The adapter context includes:

  • intent
  • step
  • snapshot
  • node
  • element
  • root

When to use it

  • framework-specific inputs
  • headless UI components
  • custom comboboxes, menus, or toggles
  • any surface where tag-only standard DOM behavior is not enough

Safety note

Adapter failures are isolated by the runtime and returned as dispatch errors instead of crashing the pipeline.

Continue reading