This is how it looks like below. I use my favorite MVP framework (Krugurt.js or Vue.js) with Yogurt to create functional and reusable web component with API callbacks.
I first create a new web component (HTML, CSS, Javascript). The props (properties) thing or its value will expose outside of the component. For example, the imageheight, imagewidth and textsize. The component is ready for mounting and ready to use everywhere in the project.
Then to reuse the web component repeatedly, just like below. I can configure the imageheight, imagewdith and textsize manually the values can be set differently to others.
I also can iterate each="..." the web component with data using fetch.
<yclass="flex justify-start items-center"><yeach="{ data in items }"><item-cardimageurl="{ data.image }"imageheight="h-48"imagewdith="w-full"textsize="text-lg"description="{ data.description }"></item-card></y></y>
I doing refactoring or making a new frontend project. I calculate how many UI components that I need to design before making them into web components with the MVP framework.
I just love making web component, it is cleaner and easy to manage.
Never tried, but seems like a modern approach from what you described 👍🔥
This is how it looks like below. I use my favorite MVP framework (
Krugurt.js
orVue.js
) with Yogurt to create functional and reusable web component with API callbacks.I first create a new web component (HTML, CSS, Javascript). The
props
(properties) thing or its value will expose outside of the component. For example, theimageheight
,imagewidth
andtextsize
. The component is ready for mounting and ready to use everywhere in the project.Then to reuse the web component repeatedly, just like below. I can configure the
imageheight
,imagewdith
andtextsize
manually the values can be set differently to others.I also can iterate
each="..."
the web component with data using fetch.I doing refactoring or making a new frontend project. I calculate how many UI components that I need to design before making them into web components with the MVP framework.
I just love making web component, it is cleaner and easy to manage.
Very well thought-out approach 👍
This seems it could be especially useful if the app scales up 🔥🔥
Yes. it is.