web-component-base
TypeScript icon, indicating that this package has built-in type declarations

4.1.1 • Public • Published

[!NOTE] The project is now in SourceHut. Please submit issues or requests via our Todo Page or via email.

Web Component Base

Package information: NPM version Package information: NPM license Package information: NPM downloads Bundle Size

🤷‍♂️ zero-dependency, 🤏 tiny JS base class for creating reactive custom elements easily ✨

counter example code snippet

When you extend the WebComponent class for your component, you only have to define the template and properties. Any change in any property value will automatically cause just the component UI to render.

The result is a reactive UI on property changes.

There's a trade off between productivity & lightweight-ness here, and it is somewhere between Microsoft's FASTElement & Google's LitElement.

Links

Want to get in touch?

There are many ways to get in touch:

  1. Email a ticket: ~ayoayco/wcb@todo.sr.ht
  2. Submit via SourceHut todo
  3. Start a GitHub discussion
  4. Email me: ayo@ayco.io

Inspirations and thanks

  1. htm - I use it for the html function for tagged templates, and take a lot of inspiration in building the rendering implementation. It is highly likely that I will go for what Preact is doing... but we'll see.
  2. fast - When I found that Microsoft has their own base class (super cool!) and I thought: okay, I don't feel bad about forgetting Lit exists now
  3. lit - lit-html continues to amaze me and I worked to make wcb generic so I (and others) can continue to use it

Package Sidebar

Install

npm i web-component-base

Weekly Downloads

93

Version

4.1.1

License

MIT

Unpacked Size

611 kB

Total Files

47

Last publish

Collaborators

  • aayco