Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Getting Started with Web Components
  • Table Of Contents Toc
  • Feedback & Rating feedback
Getting Started with Web Components

Getting Started with Web Components

By : Jadhwani
4 (5)
close
close
Getting Started with Web Components

Getting Started with Web Components

4 (5)
By: 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 (10 chapters)
close
close
7
Implementing Web Components using Polymer and Stencil

Managing States and Props

In the previous chapter, we talked about reusability and how to publish apps on the internet. We also looked into slots and how they can be helpful in extending our Web Components. 

In this chapter, we will look into state management. State management lets you keep track of the state a Web Component is in. It is a very useful technique. We will also be looking into attributes to create even better Web Components. We have been using attributes since Chapter 2Web Components Life Cycle Callback Methods. But in this chapter, we will look at it from a state management perspective. Then we will be looking into events and event management and how these events can be used to notify users of a Web Component's state.

In this chapter, we will cover the following topics:

  • Introduction to State management
  • Managing attributes and properties...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon