Introduction To Components
So how could re-useable components for your web project look like?
Components for your web projects
Section titled “Components for your web projects”I have an website starter template which uses the Astro framework that you can use as inspiration and reference. It uses the approaches that are described on this guide.
The components you will find there use Astro, so the HTML, CSS and JavaScript is contained into one .astro file, otherwise you will not have many differences. Worth mentioning though, in Astro the CSS of a component is scoped to just that component, that means styling in the does not affect other pages or other components.
View all of the components in the GitHub repository: https://github.com/BryanHogan/astro-starter-template/tree/master/src/components
How the components look like when used on a real website: https://starter.bryanhogan.com/
If you are interested in any in-depth explanations for a component let me know and I will add a guide for it here.