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.
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.
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
- 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.
- eventA software event is an occurrence, state change, or notification that a system can detect, record, communicate, or handle.
Related concepts
- wrecproduced by · Wrec is a JavaScript library for creating reactive web components as standard custom elements.
- custom element nameconfigured by · A custom element name is a browser-validated HTML tag name containing at least one hyphen, distinguishing it from native element names.
- customElements.defineproduced by · customElements.define is a browser API method that registers a custom-element name with its constructor and optional built-in-element extension options.
- form-associated custom elementincludes · A form-associated custom element is a custom HTML element that participates in form association, submission, validation, reset, and state-restoration behavior.
- Web Componentsincludes · 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.
- Angularuses · Angular is an open-source, TypeScript-based web application framework and platform for building structured, component-based client-side applications.
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.



