Create a custom element from any component with these tiny functions (2KB GZipped, ~1KB Brotli). Preact and React currently supported
The component-elements package allows users to use an HTML custom element as the root for their components. It also provides the option to use async code resolution if the custom element is not immediately used, which can help reduce code weight.
To install the component-elements package, follow these steps based on your component library:
npm install preactement
npm install reactement
Component elements are supported natively in Vue, so no specific package is required.
The component-elements package provides developers with the ability to use HTML custom elements as the root for their components. It also offers the option to use async code resolution to reduce code weight. The package is inspired by preact-custom-element and is built as a solution to slightly different needs, while also serving as a learning exercise.