> front-end

Web component

Created by: Kitman Yiu

Updated at: 1 day ago

  • Definition: Web Components are a set of browser-native technologies allowing the creation of reusable custom elements.
  • Benefits: Without web components, developers relied on specific frameworks or libraries for component creation.
  • Keywords: standardized, native technologies, reusable custom elements, Shadow DOM

1. Why do we need Web Components?

Origin: The concept of Web Components originated from the need for encapsulation and reuse in web development.

Before Web Components, developers relied on specific frameworks or libraries for component creation, leading to non-standardized and technology stack dependent solutions.

2. What Are They?

Essence: Web Components are a set of browser-native technologies allowing the creation of reusable custom elements.

  • Custom Elements: Define custom elements and behavior.
  • Shadow DOM: Encapsulate markup and style.
  • HTML Templates: `