More Premium Hugo Themes Premium React Themes

Component Elements

Create a custom element from any component with these tiny functions (2KB GZipped, ~1KB Brotli). Preact and React currently supported

Component Elements

Create a custom element from any component with these tiny functions (2KB GZipped, ~1KB Brotli). Preact and React currently supported

Author Avatar Theme by jahilldev
Github Stars Github Stars: 96
Last Commit Last Commit: Oct 23, 2024 -
First Commit Created: Jan 5, 2024 -
Component Elements screenshot

Overview:

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.

Features:

  • HTML custom element usage: Users can use an HTML custom element as the root for their components.
  • Async code resolution: The package allows the use of async code resolution if the custom element is not immediately used, helping to reduce code weight.

Installation:

To install the component-elements package, follow these steps based on your component library:

For Preact:

npm install preactement

For React:

npm install reactement

For Vue:

Component elements are supported natively in Vue, so no specific package is required.

Summary:

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.