Web Components & Stencil.js - Build Custom HTML Elements
A Complete Introduction to building Custom HTML Elements/ Web Components with and without StencilJS
Start courseLet'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!)
Course content
Section 1Introduction
- Introduction1:38
- Web Components - A Quick Demo6:30
- What are Web Components3:22
- Join our Online Learning Community1:00
- Why Do We Use Web Components?3:05
- Comparing Web Components & Frameworks6:15
- Course Outline2:46
- How To Get The Most Out Of The Course3:04
Section 2Refreshing Next Generation JavaScript (Optional)
- Module IntroductionPremium1:12
- Understanding "let" and "const"Premium3:05
- Working with Arrow FunctionsPremium5:27
- Exports and ImportsPremium4:43
- Understanding ClassesPremium4:30
- Classes, Properties and MethodsPremium3:03
- The Spread & Rest OperatorPremium6:27
- Refreshing Array FunctionsPremium2:32
- Understanding Async CodePremium1:04
- Next-Gen JavaScript - SummaryPremium1:00
- JS Array FunctionsPremium1:00
Section 3Understanding the Basics
- Module Introduction - What are Web Components?Premium5:07
- Browser SupportPremium3:05
- Our Development SetupPremium4:38
- Creating our First Custom ElementPremium8:28
- Interacting with the Surrounding DOMPremium5:04
- Understanding the Custom Elements LifecyclePremium2:51
- Using "connectedcallback" for DOM AccessPremium2:05
- Listening to Events Inside the ComponentPremium8:52
- Using Attributes on Custom ElementsPremium4:45
- "Attributes" vs "Properties"Premium1:00
- Styling our ElementsPremium4:08
- Using the Shadow DOMPremium5:00
- Adding an HTML TemplatePremium5:40
- Using SlotsPremium1:50
- Defining the Template in JavaScriptPremium3:29
- Using Style Tags in the Shadow DOMPremium2:40
- Extending Built-In ElementsPremium7:33
- Time to Practice: The Basics - ProblemPremium2:55
- Time to Practice: The Basics - SolutionPremium11:31
- DebuggingPremium1:00
- Wrap UpPremium2:30
- Useful Resources & LinksPremium1:00
Section 4Diving Deeper Into Web Components
- Module IntroductionPremium0:51
- Understanding Shadow DOM ProjectionPremium2:26
- Styling "slot" Content Outside of the Shadow DOMPremium3:44
- Styling "slot" Content Inside the Shadow DOMPremium3:10
- Styling the Host ComponentPremium4:42
- Styling Components from OutsidePremium1:00
- Conditional Host StylingPremium2:49
- Styling with the Host Content in MindPremium2:27
- Smart Dynamic Styling with CSS VariablesPremium6:20
- Cleaning Up Our Overall StylingPremium3:22
- Observing Attribute ChangesPremium6:17
- Adjusting the Component Behaviour Upon Attribute ChangesPremium2:34
- Using "disconnectedcallback"Premium4:40
- Adding a Render MethodPremium6:13
- Wrap UpPremium2:33
- Useful Resources & LinksPremium1:00
Section 5Building More Complex Components
- Module IntroductionPremium0:52
- Creating the Basics Modal ComponentPremium6:33
- Adding the Modal ContainerPremium2:29
- Styling the Modal ElementsPremium5:35
- Adding Some General App LogicPremium3:49
- Opening the Modal via CSSPremium5:23
- Public Methods & PropertiesPremium6:37
- Understanding Named SlotsPremium5:45
- "slotchange" & Getting Access to Slot ContentPremium5:10
- Closing the Modal with Modal ButtonsPremium7:01
- Dispatching Custom EventsPremium3:40
- Configuring Custom EventsPremium4:52
- Adding Enhancements & Modal AnimationsPremium4:50
- Wrap UpPremium1:48
- Useful Resources & LinksPremium1:00
Section 6Stencil - An Introduction
- Module IntroductionPremium1:21
- Using Web Components in Modern BrowsersPremium2:35
- Browser Support for Web ComponentsPremium2:27
- Using Web Components in All BrowsersPremium1:00
- Creating a Stencil ProjectPremium2:59
- What is Stencil?Premium3:09
- Stencil.js behind the ScenesPremium1:00
- Diving Into a First Stencil ComponentPremium6:56
- Wrap UpPremium1:41
Section 7Stencil - Diving Into the Basics
- Module IntroductionPremium0:35
- Using the Development ServerPremium3:19
- MUST READ: Ensuring Correct ImportsPremium1:00
- Creating a New Stencil Web ComponentPremium8:55
- Styling a Stencil ComponentPremium5:40
- Using PropsPremium7:02
- Important: Reflect Props to AttributesPremium1:00
- Configuring PropsPremium1:27
- Using Slots & StylingPremium4:54
- Rendering Conditional ContentPremium2:08
- Using Attributes for Styling onlyPremium3:27
- Using Props in Combination with AttributesPremium4:16
- Understanding Mutable PropsPremium5:33
- Preparing TabsPremium3:33
- Adding More Event ListenersPremium4:23
- Using StatePremium4:32
- Adding Methods to ComponentsPremium3:40
- Adding a BackdropPremium5:20
- Time to Practice: Stencil - ProblemPremium1:13
- Time to Practice: Stencil - SolutionPremium10:04
- Wrap UpPremium1:52
- Useful Resources & LinksPremium1:00
Section 8Advanced Stencil
- Module IntrodutionPremium0:38
- Creating a New ComponentPremium2:48
- Component & API PreparationsPremium3:57
- Submitting FormsPremium2:09
- Styling the ComponentPremium5:49
- HTTP Requests in ComponentsPremium7:43
- Using the API KeyPremium2:23
- Accessing the Host ElementPremium5:14
- Using ReferencesPremium2:52
- Two Way Binding & Input ValidationPremium6:32
- Error HandlingPremium6:07
- Using the "componentdidload" Lifecycle HookPremium5:34
- All Lifecycle HooksPremium5:16
- Using Update Lifecycle HooksPremium4:41
- Watching Prop ChangesPremium4:47
- Creating a New ComponentPremium5:56
- Styling the New ComponentPremium1:11
- Outputting a List of ElementsPremium6:20
- Styling the List ItemsPremium2:11
- Emitting Customs EventsPremium4:47
- Using the Listen DecoratorPremium6:05
- Using HostdataPremium4:37
- Adding a Loading SpinnerPremium3:53
- Embedding Components Into ComponentsPremium4:54
- Using CSS PropertiesPremium4:32
- Using Stencil.js to Build Entire AppsPremium1:00
- Wrap UpPremium1:25
- Useful Resources & LinksPremium1:00
Section 9Deployment & Publishing
- Module IntroductionPremium0:54
- Using Stencil ConfigPremium4:59
- Building & Using the ComponentsPremium4:15
- Using Web Components in a Node.js ProjectPremium2:10
- Publishing to NPMPremium3:24
- Installing NPM PackagesPremium1:27
- Using Web Components in an Angular AppPremium5:32
- Using Web Components in a React AppPremium5:18
- Using Web Components in a Vue AppPremium4:31
- Polyfills & The Internet ExplorerPremium2:49
- IE & PolyfillsPremium1:00
- Wrap UpPremium1:25
- Useful Resources & LinksPremium1:00
Section 10Roundup
- RoundupPremium2:58
- Useful Resources & LinksPremium1:00
Course instructor
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.