thanks for asking this, I'm too embarrassed to ask it myself but had the same thoughts.
JavaScript frameworks like Create React App, Next.js, Angular.js do not work like that. They completely compile the code base and inject the said components from above into an html page.
The biggest difference between a component library and a framework is that a framework requires 100% adoption, whereas a library doesn’t.