Composable custom elements
I've been enjoying the resurgent buzz around web components (specifically custom elements). The idea du jour seems to be "HTML Web Components", ie, treating components as another form of progressive enhancement: wrap your normal content with a custom element, so that the normal content gets enhanced with the web component's behavior. E.g. something like:
But what about wrapping other elements? If the idea is progressive enhancement, why not enhance your other custom elements? Guy at 11ty has created an <is-land>
component with this idea in mind (it handles boring-but-necessary stuff like loading and rendering). I'm thinking more like configurators to control the behavior of nested components.
Here we have an ordinary Game of Life component (written largely by Copilot). It accepts a couple attributes to control its behavior.
Now let's create that wrapper component and let it set those rules:
Speed
Size
Component full source can be found at script.js