liveBook · Manning

Custom Elements

Also called custom html element

A custom element is an author-defined HTML element that represents application-specific content or behavior beyond that of built-in HTML elements.

How 4 Manning books explain it

Web Components in Action

The custom elements specification defines the browser rules for registering and implementing author-created HTML elements.

How it is used
Creates reusable UI that pages can include and interact with as custom HTML elements.
How deep it goes
Works through naming, guarded registration, rendering, events, and lifecycle timing; treats Shadow DOM as a separate concern.
Examples
Builds a styled photo carousel with attribute-driven content and buttons, and tests lifecycle timing with document.createElement().
What you can do after
Build it from scratch: register an HTMLElement subclass and give its tag rendered content and interactive behavior.

Read how Web Components in Action explains Custom Elements →

Vanilla Web

A developer-defined HTML element registered through the browser's custom element APIs with custom behavior and lifecycle callbacks.

How it is used
Packages reusable interface behavior as HTML tags that participate in the DOM and expose a contract to their host pages.
How deep it goes
Works through class creation, registration, connection, independent instances, and public interfaces; treats customized built-ins as a later topic.
Examples
Uses a greeting tag, independent counter buttons, an e-commerce component family, and a React component wrapper.
What you can do after
Build it from scratch with HTMLElement and customElements.define(), then configure it through attributes or properties and handle its events.

Read how Vanilla Web explains Custom Elements →

Web Component Development with Modern Libraries and Tooling

A developer-defined HTML element registered with the browser's Custom Elements API.

How it is used
Uses developer-defined HTML tags to reuse UI and replace repeated markup across applications, including those built with different frameworks.
How deep it goes
Works through an HTMLElement subclass, registration, attributes, lifecycle rendering, and tag rules; also notes library trade-offs and integration practices.
Examples
Shows a radio-group replacing repeated inputs and labels, a clickable hello-world element, and custom elements used in Vue.
What you can do after
Build it from scratch with HTMLElement and customElements.define, then use its tag in HTML and integrate its properties and events where needed.

Read how Web Component Development with Modern Libraries and Tooling explains Custom Elements →

React Quickly, Second Edition

A custom element in this React context is an instance of a user-defined component that can be composed into an interface.

How it is used
Uses reusable components to encapsulate interface logic and reduce repeated markup.
How deep it goes
Defines component classes and renders instances, but stops before customization and more advanced component features.
Examples
Demonstrates three repeated React links, first duplicated manually and then produced from one Link component.
What you can do after
Build reusable React components from standard elements and render multiple component instances.

Read how React Quickly, Second Edition explains Custom Elements →

What to know first

Related concepts

Questions about Custom Elements

What is 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.

Which Manning books explain Custom Elements?

Web Components in Action, Vanilla Web, Web Component Development with Modern Libraries and Tooling and React Quickly, Second Edition.

What should I know before learning Custom Elements?

Manning books that teach Custom Elements usually introduce CSS, HTML, attribute and event first.

What kinds of Custom Elements are there?

Kinds of Custom Elements include form-associated custom element and Web Components.

What is Custom Elements also called?

Custom Elements is also called custom html element.

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.