Web Components & Stencil.js - Build Custom HTML Elements

A Complete Introduction to building Custom HTML Elements/ Web Components with and without StencilJS

Start
  1. Courses
  2. Web Components & Stencil.js - Build Custom HTML Elements

Let's face it: You got thousands of HTML tags to choose from but some really helpful ones (<tabs>,<side-drawer>,<modal> ...) are missing.

What if you could build your own HTML tags?

Without frameworks like Angular, libraries like React or expert JavaScript knowledge in general. Just with a magic, native-JavaScript feature called "Web Components" (or "custom HTML elements").

Web Components are a combination of various specifications that are baked into the browser. Getting started with these features is a breeze and you'll quickly be able to build your own powerful and re-usable (even across projects!) custom HTML elements.

Such custom elements don't replace Angular, React or Vue though - instead you can easily use them in ANY web project, including projects using such frameworks and libraries.

In this course, you'll learn this from scratch.

But we won't stop there. Whilst getting started is fairly easy, more complex components will be more difficult to create. Stencil.js is a tool that makes the creation of such native web components much easier by using modern features like TypeScript and JSX (don't know that? No worries, you'll learn it in the course!).

In detail, in this course you will learn:

  • how to build re-usable, lightweight custom HTML elements with native browser features
  • how to build web components of all complexities - from a simple tooltip to modals or side drawers
  • how to pass data into your own web components and use it there
  • how to emit your own custom events which you can listen to in JavaScript
  • how to use the Shadow DOM to scope your CSS styles to your custom elements
  • how to use Stencil.js to get a much easier development workflow
  • how to use the many features Stencil.js provides to build native web components way more efficiently
  • how to deploy/ re-use your own web components in ANY project using ANY JavaScript framework like Angular, React or Vue (or none at all!)

Section: Introduction

1. Introduction (1:38)
2. Web Components - A Quick Demo (6:30)
3. What are Web Components (3:22)
4. Join our Online Learning Community (1:00)
5. Why Do We Use Web Components? (3:05)
6. Comparing Web Components & Frameworks (6:15)
7. Course Outline (2:46)
8. How To Get The Most Out Of The Course (3:04)

Section: Refreshing Next Generation JavaScript (Optional)

9. Module Introduction (1:12)
10. Understanding "let" and "const" (3:05)
11. Working with Arrow Functions (5:27)
12. Exports and Imports (4:43)
13. Understanding Classes (4:30)
14. Classes, Properties and Methods (3:03)
15. The Spread & Rest Operator (6:27)
16. Refreshing Array Functions (2:32)
17. Understanding Async Code (1:04)
18. Next-Gen JavaScript - Summary (1:00)
19. JS Array Functions (1:00)

Section: Understanding the Basics

20. Module Introduction - What are Web Components? (5:07)
21. Browser Support (3:05)
22. Our Development Setup (4:38)
23. Creating our First Custom Element (8:28)
24. Interacting with the Surrounding DOM (5:04)
25. Understanding the Custom Elements Lifecycle (2:51)
26. Using "connectedcallback" for DOM Access (2:05)
27. Listening to Events Inside the Component (8:52)
28. Using Attributes on Custom Elements (4:45)
29. "Attributes" vs "Properties" (1:00)
30. Styling our Elements (4:08)
31. Using the Shadow DOM (5:00)
32. Adding an HTML Template (5:40)
33. Using Slots (1:50)
34. Defining the Template in JavaScript (3:29)
35. Using Style Tags in the Shadow DOM (2:40)
36. Extending Built-In Elements (7:33)
37. Time to Practice: The Basics - Problem (2:55)
38. Time to Practice: The Basics - Solution (11:31)
39. Debugging (1:00)
40. Wrap Up (2:30)
41. Useful Resources & Links (1:00)

Section: Diving Deeper Into Web Components

42. Module Introduction (0:51)
43. Understanding Shadow DOM Projection (2:26)
44. Styling "slot" Content Outside of the Shadow DOM (3:44)
45. Styling "slot" Content Inside the Shadow DOM (3:10)
46. Styling the Host Component (4:42)
47. Styling Components from Outside (1:00)
48. Conditional Host Styling (2:49)
49. Styling with the Host Content in Mind (2:27)
50. Smart Dynamic Styling with CSS Variables (6:20)
51. Cleaning Up Our Overall Styling (3:22)
52. Observing Attribute Changes (6:17)
53. Adjusting the Component Behaviour Upon Attribute Changes (2:34)
54. Using "disconnectedcallback" (4:40)
55. Adding a Render Method (6:13)
56. Wrap Up (2:33)
57. Useful Resources & Links (1:00)

Section: Building More Complex Components

58. Module Introduction (0:52)
59. Creating the Basics Modal Component (6:33)
60. Adding the Modal Container (2:29)
61. Styling the Modal Elements (5:35)
62. Adding Some General App Logic (3:49)
63. Opening the Modal via CSS (5:23)
64. Public Methods & Properties (6:37)
65. Understanding Named Slots (5:45)
66. "slotchange" & Getting Access to Slot Content (5:10)
67. Closing the Modal with Modal Buttons (7:01)
68. Dispatching Custom Events (3:40)
69. Configuring Custom Events (4:52)
70. Adding Enhancements & Modal Animations (4:50)
71. Wrap Up (1:48)
72. Useful Resources & Links (1:00)

Section: Stencil - An Introduction

73. Module Introduction (1:21)
74. Using Web Components in Modern Browsers (2:35)
75. Browser Support for Web Components (2:27)
76. Using Web Components in All Browsers (1:00)
77. Creating a Stencil Project (2:59)
78. What is Stencil? (3:09)
79. Stencil.js behind the Scenes (1:00)
80. Diving Into a First Stencil Component (6:56)
81. Wrap Up (1:41)

Section: Stencil - Diving Into the Basics

82. Module Introduction (0:35)
83. Using the Development Server (3:19)
84. MUST READ: Ensuring Correct Imports (1:00)
85. Creating a New Stencil Web Component (8:55)
86. Styling a Stencil Component (5:40)
87. Using Props (7:02)
88. Important: Reflect Props to Attributes (1:00)
89. Configuring Props (1:27)
90. Using Slots & Styling (4:54)
91. Rendering Conditional Content (2:08)
92. Using Attributes for Styling only (3:27)
93. Using Props in Combination with Attributes (4:16)
94. Understanding Mutable Props (5:33)
95. Preparing Tabs (3:33)
96. Adding More Event Listeners (4:23)
97. Using State (4:32)
98. Adding Methods to Components (3:40)
99. Adding a Backdrop (5:20)
100. Time to Practice: Stencil - Problem (1:13)
101. Time to Practice: Stencil - Solution (10:04)
102. Wrap Up (1:52)
103. Useful Resources & Links (1:00)

Section: Advanced Stencil

104. Module Introdution (0:38)
105. Creating a New Component (2:48)
106. Component & API Preparations (3:57)
107. Submitting Forms (2:09)
108. Styling the Component (5:49)
109. HTTP Requests in Components (7:43)
110. Using the API Key (2:23)
111. Accessing the Host Element (5:14)
112. Using References (2:52)
113. Two Way Binding & Input Validation (6:32)
114. Error Handling (6:07)
115. Using the "componentdidload" Lifecycle Hook (5:34)
116. All Lifecycle Hooks (5:16)
117. Using Update Lifecycle Hooks (4:41)
118. Watching Prop Changes (4:47)
119. Creating a New Component (5:56)
120. Styling the New Component (1:11)
121. Outputting a List of Elements (6:20)
122. Styling the List Items (2:11)
123. Emitting Customs Events (4:47)
124. Using the Listen Decorator (6:05)
125. Using Hostdata (4:37)
126. Adding a Loading Spinner (3:53)
127. Embedding Components Into Components (4:54)
128. Using CSS Properties (4:32)
129. Using Stencil.js to Build Entire Apps (1:00)
130. Wrap Up (1:25)
131. Useful Resources & Links (1:00)

Section: Deployment & Publishing

132. Module Introduction (0:54)
133. Using Stencil Config (4:59)
134. Building & Using the Components (4:15)
135. Using Web Components in a Node.js Project (2:10)
136. Publishing to NPM (3:24)
137. Installing NPM Packages (1:27)
138. Using Web Components in an Angular App (5:32)
139. Using Web Components in a React App (5:18)
140. Using Web Components in a Vue App (4:31)
141. Polyfills & The Internet Explorer (2:49)
142. IE & Polyfills (1:00)
143. Wrap Up (1:25)
144. Useful Resources & Links (1:00)

Section: Roundup

145. Roundup (2:58)
146. Useful Resources & Links (1:00)

Course Instructor

Image

Maximilian Schwarzmüller

As a self-taught professional I really know the hard parts and the difficult topics when learning new or improving on already-known languages. This background and experience enable me to focus on the most relevant key concepts and topics. My track record of many 5-star rated courses, more than 1,000,000 students worldwide as well as a successful YouTube channel is the best proof for that.

The most rewarding experience for me is to see how people find new, better jobs, build awesome web applications, work on amazing projects or simply enjoy their hobby with the help of my content. That's why, together with Manuel Lorenz, I founded Academind to offer the best possible learning experience and to share the pleasure of learning with our students.