|
2 | 2 |
|
3 | 3 | Version 0.12.0 |
4 | 4 |
|
5 | | -**UIElement** - transform reusable markup, styles and behavior into powerful, reactive, and maintainable Web Components. |
| 5 | +**UIElement** - the HTML-first microframework bringing reactivity to Web Components. |
6 | 6 |
|
7 | | -`UIElement` is a base class for Web Components with reactive states and UI effects. UIElement is tiny, around 4kB gzipped JS code, of which unused functions can be tree-shaken by build tools. It uses [Cause & Effect](https://github.com/zeixcom/cause-effect) internally for state management with signals and for scheduled DOM updates. |
| 7 | +UIElement is a set of functions to build reusable, loosely coupled Web Components with reactive properties. It provides structure through components and simplifies state management and DOM synchronization using declarative signals and effects, leading to more organized and maintainable code without a steep learning curve. |
| 8 | + |
| 9 | +Unlike SPA frameworks (React, Vue, Svelte, etc.) UIElement takes a HTML-first approach, progressively enhancing sever-rendered HTML rather than recreating (rendering) it using JavaScript. UIElement achieves the same result as SPA frameworks with SSR, but with a simpler, more efficient approach. It works with a backend written in any language or with any static site generator. |
8 | 10 |
|
9 | 11 | ## Key Features |
10 | 12 |
|
11 | | -* **Reusable Components**: Create highly modular and reusable components to encapsulate styles and behavior. |
12 | | -* **Declarative States**: Bring static, server-rendered content to life with dynamic interactivity and state management. |
13 | | -* **Signal-Based Reactivity**: Employ signals for efficient state propagation, ensuring your components react instantly to changes. |
14 | | -* **Declarative Effects**: Use granular effects to automatically synchronize UI states with minimal code. |
15 | | -* **Context Support**: Share global states across your component tree without tightly coupling logic. |
| 13 | +* 🧱 **HTML Web Components**: Build on standard HTML and enhance it with encapsulated, reusable Web Components. No virtual DOM – UIElement works directly with the real DOM. |
| 14 | +* 🚦 **Reactive Properties**: Define reactive properties for fine-grained, efficient state management (signals). Changes automatically propagate only to the parts of the DOM that need updating, avoiding unnecessary re-renders. |
| 15 | +* 🧩 **Function Composition**: Declare component behavior by composing small, reusable functions (attribute parsers and effects). This promotes cleaner code compared to spaghetti code problems that commonly occur when writing low-level imperative code. |
| 16 | +* 🛠️ **Customizable**: UIElement is designed to be easily customizable and extensible. You can create your own custom attribute parsers and effects to suit your specific needs. |
| 17 | +* 🌐 **Context Support**: Share global states across components without prop drilling or tightly coupling logic. |
| 18 | +* 🪶 **Tiny footprint**: Minimal core (~4kB gzipped) with tree-shaking support, adding only the necessary JavaScript to enhance your HTML. |
| 19 | +* 🛡️ **Type Safety**: Get early warnings when types don't match, improving code quality and reducing bugs. |
| 20 | + |
| 21 | +UIElement uses [Cause & Effect](https://github.com/zeixcom/cause-effect) internally for state management with signals and for scheduled DOM updates. But you could easily rewrite the `component()` function to use a signals library of your choice or to produce something else than Web Components. |
16 | 22 |
|
17 | 23 | ## Installation |
18 | 24 |
|
|
0 commit comments