Component Elements

screenshot of Component Elements
react
vue

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

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.

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.

react
React

React is a widely used JavaScript library for building user interfaces and single-page applications. It follows a component-based architecture and uses a virtual DOM to efficiently update and render UI components

vue
Vue

Vue.js is a lightweight and flexible JavaScript framework that allows developers to easily build dynamic and reactive user interfaces. Its intuitive syntax, modular architecture, and focus on performance make it a popular choice for modern web development.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.

web-components
Web Components

Web components provide a way to create reusable, encapsulated UI components using standard web technologies such as HTML, CSS, and JavaScript. They allow developers to create complex UI components that can be easily shared across multiple projects and frameworks. Web components are built using four main specifications: Custom Elements, Shadow DOM, HTML Templates, and ES Modules.

webpack
Webpack

Webpack is a popular open-source module bundler for JavaScript applications that bundles and optimizes the code and its dependencies for production-ready deployment. It can also be used to transform other types of assets such as CSS, images, and fonts.