Improve Support for Web Components in Forms with "Element Adapters"

If I’m understanding the proposal correctly, I’m imagining this as a set of protocols or behaviours for high level element concepts.

That would remind me of React’s approach to allowing libraries to implement custom Input elements while still benefiting from all the compatibility. Obviously they did that with class inheritance and later extends but the idea feels similar to me. A contract for different fundamental concepts, treated like an interface, and a pattern for implementing new interface when it’s determined that those fundamental concepts weren’t expressive enough.

All this feels really similar to the struggles the frontend js space has had to deal with and adapt to.

I could imagine MySillyCombobox as a module combined a web component inside the render powering it that then implements some protocol called Select.

Then if you are a maintainer of a headless container library equivalent to Radix, you just have to come up with the new protocol surface the WAI ARIA concepts that aren’t directly supported in HTML.

1 Like