Web Components
The complete path through Web Components: custom elements, shadow DOM and slots, styling, accessibility, forms, Lit, server rendering, frameworks, and design systems, then how browsers run it all under the hood. Every component you build runs in your browser, and works in any page and any framework.
What are web components?
A web component is an HTML tag you make yourself, and it works in any page and any framework. The Web Components lessons are being written, and this one opens first.
// What you’ll learn
- Tags you define yourself
- The standards behind them
- What they are and what they aren't
- Who uses them: Photoshop on the web, Edge, MDN, Firefox
- A map of this course
Your progress
View detailed statsYour progress starts with the first published lesson.
- day streak
- 0
- days this week
- 0
- stages done
- 0/16
The learning path
214 lessons coming soon16 stages, in order. Each one builds on the last, from using your first component to reading how browsers create, slot, and style them. Every lesson is listed now, and each one opens as soon as it's published. Jump to a stage, or search for any topic.
- STAGE 1 · BEGINNERGetting started2 modules · 9 lessons
- STAGE 2 · BEGINNERCustom elements3 modules · 16 lessons
- STAGE 3 · BEGINNER TO INTERMEDIATEShadow DOM, templates, and slots5 modules · 20 lessons
- STAGE 4 · INTERMEDIATEStyling web components2 modules · 14 lessons
- STAGE 5 · INTERMEDIATEAccessible components3 modules · 13 lessons
- STAGE 6 · INTERMEDIATEForms2 modules · 9 lessons
- STAGE 7 · INTERMEDIATEBuilding components well2 modules · 10 lessons
- STAGE 8 · INTERMEDIATELit3 modules · 14 lessons
- STAGE 9 · ADVANCEDServer rendering2 modules · 10 lessons
- STAGE 10 · ADVANCEDFrameworks and libraries2 modules · 11 lessons
- STAGE 11 · ADVANCEDTesting, tooling, and publishing3 modules · 12 lessons
- STAGE 12 · ADVANCEDDesign systems2 modules · 9 lessons
- STAGE 13 · ADVANCEDApplications and performance3 modules · 12 lessons
- STAGE 14 · EXPERTUnder the hood4 modules · 25 lessons
- STAGE 15 · EXPERTBuild it yourself, and the standards behind it4 modules · 16 lessons
- STAGE 16 · ADVANCEDProjects4 modules · 14 lessons
214 lessons in 16 stages and 46 modules.
Stage 1 Beginner
Getting started
What web components are, where they stand in 2026, and how to use components other people built.
2 modules · 9 lessons
- 0 of 4 lessons ready
Module 1: Welcome to web components
What a web component is, what works today, when to reach for one, and your setup.
- 1.1What are web components?Soon
- 1.2Web components in 2026Soon
- 1.3When to use web components, and when notSoon
- 1.4Your setup and the course projectSoon
- 0 of 5 lessons ready
Module 2: Using web components
Use components someone else built: load them, talk to them, theme them, and avoid a flash of unstyled tags.
- 2.1Using a component librarySoon
- 2.2Talking to a component from JavaScriptSoon
- 2.3Theming components from the outsideSoon
- 2.4Before the definition loads: :definedSoon
- 2.5Web components in frameworks and on servers: a previewSoon
Stage 2 Beginner
Custom elements
Define your own elements: the class, the lifecycle, upgrades, the registry, and a clean public API.
3 modules · 16 lessons
- 0 of 6 lessons ready
Module 3: Your first custom element
A class, a name, and the callbacks the browser calls as the element lives on the page.
- 3.1Your first custom elementSoon
- 3.2What the constructor may doSoon
- 3.3connectedCallback and disconnectedCallbackSoon
- 3.4Reacting to attributesSoon
- 3.5Moving and adopting elementsSoon
- 3.6The whole lifecycle, in orderSoon
- 0 of 3 lessons ready
Module 4: Upgrades and the registry
Elements can exist before their definition. Learn how upgrades work and how registries keep names apart.
- 4.1Upgrades: elements before their definitionSoon
- 4.2Properties set before the upgradeSoon
- 4.3Loading definitions on demandSoon
- 0 of 7 lessons ready
Module 5: A component's public API
Attributes, properties, events, and methods: the parts of a component other people use.
- 5.1Attributes and propertiesSoon
- 5.2Boolean, number, and enum attributesSoon
- 5.3Dispatching eventsSoon
- 5.4Designing a component APISoon
- 5.5Working with childrenSoon
- 5.6HTML web componentsSoon
- 5.7Customized built-in elementsSoon
Stage 3 Beginner to intermediate
Shadow DOM, templates, and slots
Give a component a private inside, put the user's content where it belongs, and handle events and focus across the boundary.
5 modules · 20 lessons
- 0 of 5 lessons ready
Module 6: Shadow roots
A private DOM tree inside an element: what it hides, what it doesn't, and when to skip it.
- 6.1What is shadow DOM?Soon
- 6.2Open and closed shadow rootsSoon
- 6.3What encapsulation meansSoon
- 6.4When to skip shadow DOMSoon
- 6.5Scoped custom element registriesSoon
- 0 of 3 lessons ready
Module 7: Templates and rendering
Reusable markup with template, and the ways a component can put its markup on the page.
- 7.1The template elementSoon
- 7.2Filling a template with dataSoon
- 7.3Ways to render a componentSoon
- 0 of 5 lessons ready
Module 8: Slots and composition
Let users put their own content inside your component, exactly where you want it.
- 8.1Slots: putting content in placeSoon
- 8.2Light DOM, shadow DOM, and the flat treeSoon
- 8.3The slot APISoon
- 8.4Reacting to slotted contentSoon
- 8.5Manual slot assignmentSoon
- 0 of 4 lessons ready
Module 9: Events and focus across the boundary
How events, focus, and selection behave when they cross a shadow root.
- 9.1Event retargetingSoon
- 9.2Composed eventsSoon
- 9.3Focus and shadow DOMSoon
- 9.4Walking the composed treeSoon
- 0 of 3 lessons ready
Module 10: A first real component
Put the pieces together in a tabs component, and learn to debug it.
- 10.1Build tabs: structure and APISoon
- 10.2Build tabs: selection and eventsSoon
- 10.3Debugging web componentsSoon
Stage 4 Intermediate
Styling web components
Style a component from the inside, and give the people using it a clear, safe way to style it from the outside.
2 modules · 14 lessons
- 0 of 7 lessons ready
Module 11: Styles inside the shadow root
Where component styles live, which rules win, and how to share them without copying.
- 11.1Styles inside a shadow rootSoon
- 11.2Styling the hostSoon
- 11.3Styling slotted contentSoon
- 11.4Who wins: the shadow cascadeSoon
- 11.5Constructable stylesheetsSoon
- 11.6CSS module scriptsSoon
- 11.7Fonts and shadow DOMSoon
- 0 of 7 lessons ready
Module 12: A styling API for others
Give users safe, documented ways to style your component, and make it fit any layout.
- 12.1Custom properties as a styling APISoon
- 12.2Parts: ::part and exportpartsSoon
- 12.3Custom states and :state()Soon
- 12.4Page styles for componentsSoon
- 12.5Container queries in componentsSoon
- 12.6Organizing component CSSSoon
- 12.7Motion in componentsSoon
Stage 5 Intermediate
Accessible components
Make components that screen readers, keyboards, and every visitor can use, across shadow roots.
3 modules · 13 lessons
- 0 of 5 lessons ready
Module 13: Semantics across shadow roots
Roles, names, and relationships when part of the markup is hidden in a shadow tree.
- 13.1Accessibility and shadow DOMSoon
- 13.2ARIA with ElementInternalsSoon
- 13.3ARIA references across shadow rootsSoon
- 13.4Labels and descriptionsSoon
- 13.5Announcing changesSoon
- 0 of 5 lessons ready
Module 14: Keyboard and focus
Keyboard support that matches the ARIA patterns, built with real components.
- 14.1Focus delegation and focus stylesSoon
- 14.2Keyboard navigation with roving tabindexSoon
- 14.3Accessible tabsSoon
- 14.4An accessible accordionSoon
- 14.5Dialogs and popovers in componentsSoon
- 0 of 3 lessons ready
Module 15: Visual access and testing
Color, contrast, forced colors, writing direction, and how to test it all.
- 15.1Color, contrast, and forced colorsSoon
- 15.2Right-to-left and logical propertiesSoon
- 15.3Testing accessibilitySoon
Stage 6 Intermediate
Forms
Make components that join forms like native inputs: values, validation, reset, restore, and submission.
2 modules · 9 lessons
- 0 of 5 lessons ready
Module 16: Form-associated custom elements
ElementInternals lets a custom element be a real form control.
- 16.1Joining a formSoon
- 16.2Form valuesSoon
- 16.3ValidationSoon
- 16.4Form lifecycle callbacksSoon
- 16.5Wrap a native input or build your ownSoon
- 0 of 4 lessons ready
Module 17: Building form controls
Build real controls end to end, then pull the shared parts into a base class.
- 17.1Build a switchSoon
- 17.2Build a buttonSoon
- 17.3Build an inputSoon
- 17.4A base class for form controlsSoon
Stage 7 Intermediate
Building components well
Reactive rendering, a toolkit of your own, and patterns for data and composition, before reaching for a library.
2 modules · 10 lessons
- 0 of 5 lessons ready
Module 18: Reactive rendering by hand
Update the screen when data changes, efficiently, with only the platform.
- 18.1Reactive propertiesSoon
- 18.2Rendering with tagged templatesSoon
- 18.3Lists and keysSoon
- 18.4Data flow between componentsSoon
- 18.5Signals in componentsSoon
- 0 of 5 lessons ready
Module 19: A toolkit of your own
Pull repeated code into a small base class and helpers, the way libraries do.
- 19.1A component base classSoon
- 19.2Declaring attributesSoon
- 19.3Mixins, controllers, and behaviorsSoon
- 19.4Context and dependency injectionSoon
- 19.5Async data in componentsSoon
Stage 8 Intermediate
Lit
Lit is the most used web components library. Learn it from the first component to publishing.
3 modules · 14 lessons
- 0 of 6 lessons ready
Module 20: Lit basics
LitElement, reactive properties, templates, styles, and events.
- 20.1Why Lit?Soon
- 20.2Reactive properties in LitSoon
- 20.3Lit templatesSoon
- 20.4Conditions and lists in LitSoon
- 20.5Styles in LitSoon
- 20.6Events in LitSoon
- 0 of 5 lessons ready
Module 21: Lit in depth
The update lifecycle, directives, controllers, context, tasks, signals, and localization.
- 21.1The Lit update lifecycleSoon
- 21.2Lit directivesSoon
- 21.3Reactive controllers and mixins in LitSoon
- 21.4Context and tasks in LitSoon
- 21.5Signals in LitSoon
- 0 of 3 lessons ready
Module 22: Shipping Lit
Localize Lit components, wrap them for frameworks, and test and publish them.
- 22.1Localizing Lit componentsSoon
- 22.2Wrapping Lit components for frameworksSoon
- 22.3Testing and publishing LitSoon
Stage 9 Advanced
Server rendering
Send components as HTML with declarative shadow DOM, hydrate them, and use them with server frameworks.
2 modules · 10 lessons
- 0 of 5 lessons ready
Module 23: Declarative shadow DOM
Shadow roots written in HTML, so components show before JavaScript runs.
- 23.1Declarative shadow DOMSoon
- 23.2Declarative shadow DOM and HTML APIsSoon
- 23.3Hydrating custom elementsSoon
- 23.4Sharing styles in server-rendered componentsSoon
- 23.5Declarative shadow DOM in practiceSoon
- 0 of 5 lessons ready
Module 24: Servers and frameworks
Server renderers for web components and how to choose one.
- 24.1Server rendering optionsSoon
- 24.2Lit on the serverSoon
- 24.3HTML-first frameworks: Enhance and WebCSoon
- 24.4Web components in Astro and Next.jsSoon
- 24.5Components that work before JavaScriptSoon
Stage 10 Advanced
Frameworks and libraries
Use web components inside frameworks, make web components from frameworks, and choose a library.
2 modules · 11 lessons
- 0 of 5 lessons ready
Module 25: Web components inside frameworks
Properties, events, forms, and types in each popular framework.
- 25.1Web components in ReactSoon
- 25.2Web components in VueSoon
- 25.3Web components in AngularSoon
- 25.4Web components in Svelte, Solid, and PreactSoon
- 25.5Types for every frameworkSoon
- 0 of 6 lessons ready
Module 26: Libraries and frameworks that make web components
Other ways to build components, and how to choose.
- 26.1Custom elements from Vue, Angular, and SvelteSoon
- 26.2StencilSoon
- 26.3FAST and Web AwesomeSoon
- 26.4Design system librariesSoon
- 26.5Small librariesSoon
- 26.6Choosing a library, or noneSoon
Stage 11 Advanced
Testing, tooling, and publishing
Test components in real browsers, describe them with a manifest, and publish them safely.
3 modules · 12 lessons
- 0 of 5 lessons ready
Module 27: Testing components
Unit, end-to-end, accessibility, and visual tests that see into shadow roots.
- 27.1Unit testing componentsSoon
- 27.2Testing through shadow rootsSoon
- 27.3End-to-end and visual testsSoon
- 27.4Automated accessibility testsSoon
- 27.5Storybook for componentsSoon
- 0 of 4 lessons ready
Module 28: Tooling
TypeScript, the Custom Elements Manifest, linting, and builds.
- 28.1TypeScript for web componentsSoon
- 28.2The Custom Elements ManifestSoon
- 28.3Linting componentsSoon
- 28.4Building componentsSoon
- 0 of 3 lessons ready
Module 29: Publishing components
Package, version, and release components so they're safe to use anywhere.
- 29.1Packaging componentsSoon
- 29.2Versions, monorepos, and releasesSoon
- 29.3Polyfills in 2026Soon
Stage 12 Advanced
Design systems
Build and run a design system on web components: specs, tokens, themes, docs, and teams.
2 modules · 9 lessons
- 0 of 5 lessons ready
Module 30: Foundations of a design system
What a design system is, how components are specified, and how tokens and themes work.
- 30.1What is a design system?Soon
- 30.2Component specificationsSoon
- 30.3Design tokensSoon
- 30.4ThemesSoon
- 30.5Headless components and behaviorsSoon
- 0 of 4 lessons ready
Module 31: Running a design system
Organize, document, localize, and hand off a component library.
- 31.1Organizing a component librarySoon
- 31.2Documenting a design systemSoon
- 31.3From design to codeSoon
- 31.4Internationalizing a component librarySoon
Stage 13 Advanced
Applications and performance
Build whole applications from web components, keep them secure, and make them fast.
3 modules · 12 lessons
- 0 of 5 lessons ready
Module 32: Application architecture
How an app made of web components is structured, started, routed, and shared between teams.
- 32.1Application architecturesSoon
- 32.2The app shell and startupSoon
- 32.3Routing and view transitionsSoon
- 32.4State in applicationsSoon
- 32.5Micro-frontends with web componentsSoon
- 0 of 4 lessons ready
Module 33: Application features
Icons, shared styles, data, security, and offline support in an app made of components.
- 33.1Icons and shared styles in appsSoon
- 33.2Templating over dataSoon
- 33.3Security for componentsSoon
- 33.4Progressive web apps with web componentsSoon
- 0 of 3 lessons ready
Module 34: Performance
Measure and improve how fast components load and render.
- 34.1What web components costSoon
- 34.2Loading components fastSoon
- 34.3Rendering fastSoon
Stage 14 Expert
Under the hood
How browsers and libraries implement custom elements, shadow DOM, slots, events, styles, forms, and accessibility, read from the source.
4 modules · 25 lessons
- 0 of 7 lessons ready
Module 35: Custom elements inside the browser
Definitions, element states, creation paths, reactions, and upgrades, as the engine runs them.
- 35.1Definitions and element statesSoon
- 35.2How elements get createdSoon
- 35.3The construction stackSoon
- 35.4Custom element reactionsSoon
- 35.5The upgrade algorithmSoon
- 35.6Scoped registries insideSoon
- 35.7Moves and adoption insideSoon
- 0 of 5 lessons ready
Module 36: Shadow DOM inside the browser
Tree scopes, slot assignment, the flat tree, the event path, and focus in the engine.
- 36.1Shadow trees and tree scopesSoon
- 36.2Slot assignment insideSoon
- 36.3The flat tree and layoutSoon
- 36.4The event path and retargetingSoon
- 36.5Focus inside shadow rootsSoon
- 0 of 6 lessons ready
Module 37: Styles, forms, and accessibility inside
How the engine scopes styles, shares sheets, associates forms, builds the accessibility tree, and parses declarative roots.
- 37.1Style scoping insideSoon
- 37.2Adopted stylesheets insideSoon
- 37.3The form owner insideSoon
- 37.4Form submission insideSoon
- 37.5The accessibility tree insideSoon
- 37.6Declarative shadow DOM insideSoon
- 0 of 7 lessons ready
Module 38: Libraries inside
How Lit, Stencil, FAST, and frameworks' custom element support work, read from their source.
- 38.1How lit-html rendersSoon
- 38.2How ReactiveElement updatesSoon
- 38.3How Lit SSR and hydration workSoon
- 38.4How Stencil worksSoon
- 38.5How FAST worksSoon
- 38.6How React handles custom elementsSoon
- 38.7How Vue, Angular, and Svelte handle custom elementsSoon
Stage 15 Expert
Build it yourself, and the standards behind it
Build your own component framework, read the specs, and follow how web components were made and where they're going.
4 modules · 16 lessons
- 0 of 5 lessons ready
Module 39: Build your own component framework
Build a small Lit-like framework from scratch, one piece per lesson.
- 39.1Build a reactive base classSoon
- 39.2Build a template engine: parsingSoon
- 39.3Build a template engine: updatesSoon
- 39.4Build directivesSoon
- 39.5Build keyed listsSoon
- 0 of 3 lessons ready
Module 40: Build your own server rendering and polyfills
Render your framework's components on the server, hydrate them, and write a polyfill.
- 40.1Build server renderingSoon
- 40.2Build hydrationSoon
- 40.3Build a scoped registry polyfillSoon
- 0 of 4 lessons ready
Module 41: Reading the standards
Read the HTML and DOM specifications, and test the platform yourself.
- 41.1Reading the HTML spec for custom elementsSoon
- 41.2Reading the DOM spec for shadow treesSoon
- 41.3Reading CSS Shadow Module Level 1Soon
- 41.4Web platform tests and browser bugsSoon
- 0 of 4 lessons ready
Module 42: History and the road ahead
How web components came to be, how standards are made, and what's next.
- 42.1A history of web componentsSoon
- 42.2How web standards get madeSoon
- 42.3The road aheadSoon
- 42.4Component models comparedSoon
Stage 16 Advanced
Projects
Guided projects and a capstone that use the whole course.
4 modules · 14 lessons
- 0 of 4 lessons ready
Module 43: Guided project: a UI kit
Grow the course's components into an accessible UI kit, one milestone per lesson.
- 43.1UI kit: plan and foundationsSoon
- 43.2UI kit: disclosure, accordion, and dialogSoon
- 43.3UI kit: a comboboxSoon
- 43.4UI kit: tests and docsSoon
- 0 of 3 lessons ready
Module 44: Guided project: form controls
Build the form controls the kit still needs, and prove they work in frameworks.
- 44.1Form controls: a selectSoon
- 44.2Form controls: a date inputSoon
- 44.3Form controls in frameworksSoon
- 0 of 3 lessons ready
Module 45: Guided project: an app and a server-rendered site
Use the kit to build a tea shop app, then render its pages on the server.
- 45.1App: shell and routesSoon
- 45.2App: data and formsSoon
- 45.3A server-rendered siteSoon
- 0 of 4 lessons ready
Module 46: Capstone: your own design system
Build, test, document, and ship a design system of your own.
- 46.1Capstone: plan and tokensSoon
- 46.2Capstone: componentsSoon
- 46.3Capstone: docs and testsSoon
- 46.4Capstone: ship itSoon