Web Components
Web Components are browser standards and APIs, including custom elements and shadow DOM, for creating reusable web interface elements with encapsulated structure, presentation, and behavior.
Web Components in Action
A web component is a reusable web platform component with encapsulated structure, styling, behavior, and APIs.
- How it is used
- Uses custom HTML elements to package reusable interface behavior, from individual controls to applications composed of components.
- How deep it goes
- Builds components step by step, then examines configurable APIs, lifecycle methods, encapsulation, modules, and composition.
- Examples
- Develops a slider and photo carousel, then uses composed components for a musical instrument and a hand-tracking interface.
- What you can do after
- Build it from scratch using HTMLElement and customElements.define, then configure it with attributes and connect it through events.
Vanilla Web
A reusable custom HTML element built using browser standards such as custom elements, shadow DOM, and HTML templates.
- How it is used
- Packages reusable UI behavior, markup, and styling as custom HTML elements.
- How deep it goes
- Builds from registration through lifecycle, interfaces, shadow DOM, and styling; defers detailed template and Element Internals treatment.
- Examples
- Uses independent counter buttons and routed page elements to demonstrate reusable instances and screen-level components.
- What you can do after
- Build it from scratch using customElements.define(), lifecycle callbacks, and an explicit attributes–properties–events contract.
Web Component Development with Modern Libraries and Tooling
A reusable web interface element implemented with encapsulated HTML, CSS, and JavaScript and exposed through the browser platform.
- How it is used
- Uses reusable custom elements to reduce repeated UI markup and share components across applications and frameworks.
- How deep it goes
- Works from element markup through vanilla class registration and browser upgrade, then compares libraries and framework integration.
- Examples
- Shows a radio-group replacing repeated inputs and labels, plus a greeting button implemented with a JavaScript class.
- What you can do after
- Build it from scratch with browser APIs, or evaluate libraries and integrate existing components into framework applications.
Read how Web Component Development with Modern Libraries and Tooling explains Web Components →
Also covered in
What to know first
- JavaScriptJavaScript is a high-level, dynamically typed programming language standardized as ECMAScript and used for web and general-purpose programming.
- CSSCSS (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
- HTMLHTML is the standard markup language for structuring content and elements in documents on the web.
- attributeAn attribute is a named property or piece of information associated with an entity, object, or structured data item.
Related concepts
- Shadow DOMuses · Shadow DOM is a web platform mechanism for attaching a DOM subtree to an element while encapsulating its structure and styles from the surrounding document.
- Reactused by · React is an open-source JavaScript library for building user interfaces from declarative, reusable components.
- Custom Elementskind of · A custom element is an author-defined HTML element that represents application-specific content or behavior beyond that of built-in HTML elements.
- eventuses · A software event is an occurrence, state change, or notification that a system can detect, record, communicate, or handle.
- Litused by · Lit is a lightweight JavaScript library for building standards-based web components with declarative templates and reactive state.
Questions about Web Components
What is Web Components?
Web Components are browser standards and APIs, including custom elements and shadow DOM, for creating reusable web interface elements with encapsulated structure, presentation, and behavior.
Which Manning books explain Web Components?
Web Components in Action, Vanilla Web and Web Component Development with Modern Libraries and Tooling.
What should I know before learning Web Components?
Manning books that teach Web Components usually introduce JavaScript, CSS, HTML and attribute first.
What is Web Components a kind of?
Web Components is a kind of Custom Elements. A custom element is an author-defined HTML element that represents application-specific content or behavior beyond that of built-in HTML elements.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


