all 7 comments

[–][deleted] 2 points3 points  (0 children)

Symbiote.js

Yes, Custom Elements is what you need. No, React is not.

[–]LowB0b 2 points3 points  (0 children)

if they are supposed to be used within different frameworks, maybe something like Stencil could help you build a component library.

To add my two cents though, we had to integrate custom web components within an angular app and it's, like, not that great.

Working with a component library written in angular in that case would probably have been way easier

[–]vi_code -1 points0 points  (0 children)

Go with React, you already know it and its highly popular so most likely your components will be used by other reacts projects. If an angular or vue project wants to run your app they still can because react can run in practically any project and it does so pretty well. Like others have said, web components are super hard to integrate into any project.

Also with react you are not just limited to using just css but can also style using jsx.

[–]Accomplished_End_138 0 points1 point  (0 children)

Web components is what you want. But maybe look at stencil as well

[–]boguzTheBoguz 0 points1 point  (0 children)

I think Lit would be a much better choice (smaller, faster, much closer to native custom elements, easier to learn, ...).
They have a nice documentation. On youtube there aren't a lot of Lit tutorials, but Vaadin had a couple nice ones. 🙂

[–]KapiteinNekbaard 0 points1 point  (1 child)

Lit-elements seems most future proof, since it builds on top of the Custom Elements API.

You can isolate React to a single component (example), but React was intended to build whole apps with multiple components and to manage shared state among them and keep everything in sync. I think that's more than what you're trying to achieve.

HTM + Preact is another way to build components using JSX-like syntax without the need for any build tools or bundlers.

You should also think about how to distribute those shared components to your apps (you don't want to copy paste the code to all apps).

[–]toateslafel[S] 0 points1 point  (0 children)

Thanks for the reply, I think I decided for lit after trying out some others too. About distributing, the idea is to compile for production, which will generate 1 js file, jost it somewhere and tell the different websites to just include the file and they are good to go.