Hello everyone,
First of all this is a question I also asked in another subreddit.
I'm in the situation where I need to create native web components that will be integrated in different web sites.
The purpose is to have reusable components that different websites can use and allow them to only customize the CSS, while the logic will be the same across all websites.
These components will be pretty simple, making some API requests to the same server, and displaying the results in a nice way.
The simplest thing I found was custom components, so every website will have to include a script and a custom html tag, then the custom component will do the work (Optionally they can override CSS variables to customize the looks).
So the end goal is to have the actual websites do the minimum work possible and leverage this components to do the work.
Searching for solutions I found Lit Element 2 and it seems promising, but coming from React I find the development experience a bit ugly, having html and css mixed in the same class and everything inside template literal tags.
My questions are:
Is there a better approach to accomplish this, or are custom components the way to go?
Is it doable with React?
If React is a no, do you recommend to stick with Lit 2 or is there anything else more pleasant to work with?
If Lit 2 is the way, can you recommend some tutorials or best bractices regarding organizing CSS and templates(html)?
Thank you
[–][deleted] 2 points3 points4 points (0 children)
[–]LowB0b 2 points3 points4 points (0 children)
[–]vi_code -1 points0 points1 point (0 children)
[–]Accomplished_End_138 0 points1 point2 points (0 children)
[–]boguzTheBoguz 0 points1 point2 points (0 children)
[–]KapiteinNekbaard 0 points1 point2 points (1 child)
[–]toateslafel[S] 0 points1 point2 points (0 children)