Book Image

Getting Started with Web Components

By : Prateek Jadhwani
Book Image

Getting Started with Web Components

By: Prateek Jadhwani

Overview of this book

Web Components are a set of APIs that help you build reusable UI modules that can operate in any modern browser using just Vanilla JavaScript. The power of Web Components lies in their ability to build frontend web applications with or without web frameworks. With this practical guide, you will understand how Web Components can help you build reusable UI components for your modern web apps. The book starts by explaining the fundamentals of Web Components' design and strategies for using them in your existing frontend web projects. You will also learn how to use JavaScript libraries such as Polymer.js and Stencil.js for building practical components. As you progress, you will build a single-page application using only Web Components to fully realize their potential. This practical guide demonstrates how to work with Shadow DOM and custom elements to build the standard components of a web application. Toward the end of the book, you will learn how to integrate Web Components with standard web frameworks to help you manage large-scale web applications. By the end of this book, you will have learned about the capabilities of Web Components in building custom elements and have the necessary skills for building a reusable UI for your web applications.
Table of Contents (14 chapters)
Title Page
7
Implementing Web Components using Polymer and Stencil

Integrating Web Components with a Web Framework

In the previous chapters, we have either created Web Components from scratch or used a library to create Web Components. We even created a single-page web app using just Web Components. But what if we have an already-existing project? What if this is a monolithic frontend web application and we need a way to use a web component in this project? And what if we want to use a web component for a quick prototyped functionality without much overhead? This could save a lot of effort in both time and money.

This chapter is just for scenarios like this one; here we will look into ways in which we can use Web Components in already-existing projects. 


By the way, this chapter is for advanced users. 

I am assuming that you have worked on React, Angular, or Vue and that you are looking for ways to include Web Components into web applications...