Courses / Specialisations & media / Web Components

₹39Self-paced

Web Components

Build a small library of accessible custom elements that work in plain HTML and inside frameworks, with interoperability tests.

  • Who it's for. Front-end learners who know HTML, CSS and DOM scripting and want reusable components that do not depend on one framework.
  • Before you start. Prerequisite courses: Web Foundations: HTML, CSS and Responsive Layouts, JavaScript DOM & Browser APIs.
  • 25 to 43 hours of study with practice
  • 8 modules, 42 lessons
  • 3 guided projects and a final project

What you'll learn

  • Register and implement autonomous custom elements whose constructor, lifecycle callbacks and cleanup behave as the HTML standard specifies.
  • Use Shadow DOM, templates, slots, parts, custom properties and custom states with a clear account of what encapsulation protects.
  • Build form-associated custom elements with values, validation and form callbacks.
  • Make custom elements operable by keyboard and assistive technology across shadow boundaries.
  • Package, test, document and smoke-test a reusable element library with Playwright, with or without Lit 3.

Skills you'll gain

  • Custom-element lifecycle
  • Attributes
  • properties
  • Shadow DOM
  • Slots
  • composition
  • Events
  • forms
  • Styling
  • accessibility
  • Framework interoperability
  • Component packaging

Tools you'll use

  • Custom Elements
  • Shadow DOM
  • Playwright
  • Lit 3 (optional)

Details to know

  • Certificate on completionIssued after your final project is reviewed
  • 8 module checkpointsA quiz and a practical task close each module
  • Self-pacedStudy any time; your progress is saved

How every lesson works

Each lesson follows the same four steps, so you always know what comes next.

  1. 01

    Watch & Learn

    A short animated video explains one idea at a time.

  2. 02

    Guided Practice

    Work through an example step by step and check the result.

  3. 03

    Quiz & Challenge

    Short questions check the idea has landed before you move on.

  4. 04

    Mini Project

    Build something useful from a project brief.

Learn at your own pace

This is a self-paced course. There are no live classes and no fixed timetable.

  • Start any timeStudy when it suits you. Lessons are short, so they fit around work or college.
  • Pick up where you left offYour progress is saved to your account.
  • Ask when you're stuckUse Ask Mentor inside the learning platform.

Your path in 4 phases

Each phase ends with something you have built and checked.

  1. 01

    Modules 1 to 3

    Custom-element lifecycle to Shadow DOM

    Register autonomous custom elements correctly and predict, from the WHATWG rules, which lifecycle callbacks run, in what order and how many times.

    You build: Guided project “A themeable, encapsulated card element”: Registered `lib-card` with side-effect-free construction and a 1,0,1 listener counter.

  2. 02

    Modules 4 to 5

    Slots and composition to Events and forms

    Compose elements through default, named and manually assigned slots, react to slot changes and style slotted content within its limits.

    You build: Guided project “Compound tabs and a form-associated rating”: `lib-tabs` pairing slotted tabs and panels with add/remove handling.

  3. 03

    Modules 6 to 7

    Styling and accessibility to Framework interoperability

    Expose deliberate styling hooks and make custom controls operable by keyboard and assistive technology across shadow boundaries.

    You build: Guided project “Accessible, framework-neutral kit with an interop matrix”: Documented custom properties, parts and states for the kit.

  4. 04

    Module 8

    Component packaging

    Package, test, document and verify a reusable element library, with and without Lit, and prove the published artifact works from a clean install.

    You build: Final project build and trainer-reviewed demonstration (see project).

Full curriculum

8 modules and 42 lessons, 25 to 43 hours of study

01Custom-element lifecycle5 lessons, 2 to 4 hours

Lessons

  • Registering an autonomous element under a valid name
  • Constructor discipline: what a custom element may not do
  • connectedCallback, disconnectedCallback and guarded setup
  • Upgrading markup that exists before the definition
  • Moves between documents and parents: adoptedCallback and connectedMoveCallback

After this module you can

  • Register a class with customElements.define and classify six candidate tag names as valid or invalid by the naming rules.
  • Rewrite a constructor that reads attributes and appends children so that it only calls super() and initialises private fields.
  • Log adoptedCallback for a cross-document move and decide, with feature detection, whether connectedMoveCallback is available and suppresses reconnect pairs.
02Attributes and properties5 lessons, 2 to 4 hours

Lessons

  • observedAttributes and attributeChangedCallback
  • Reflecting a property to an attribute without loops
  • Boolean, number and enumerated attributes
  • Properties set before the element is upgraded
  • Rich-data properties and batched rendering

After this module you can

  • Declare observedAttributes and show that attributeChangedCallback fires only for observed names, including once on initial parse.
  • Implement a property whose getter reads and whose setter writes the matching attribute, and prove that it does not re-enter itself.
  • Accept objects and arrays only through properties and coalesce several changes into one render using queueMicrotask.
03Shadow DOM5 lessons, 2 to 4 hours

Lessons

  • Attaching open and closed shadow roots
  • Style encapsulation and :host styling
  • Template elements and cloning for fast, safe rendering
  • Declarative shadow DOM and server-rendered hosts
  • Constructable stylesheets and adoptedStyleSheets

After this module you can

  • Attach a shadow root in open and closed mode and show how host.shadowRoot and document queries differ between them.
  • Show that page CSS does not reach shadow content and shadow CSS does not leak, and style the host using :host and :host().
  • Share one CSSStyleSheet between many shadow roots with adoptedStyleSheets and update them all with replaceSync.
04Slots and composition5 lessons, 2 to 4 hours

Lessons

  • Default slots, named slots and fallback content
  • Reading assignments with assignedElements and slotchange
  • Styling slotted content with ::slotted and its limits
  • Manual slot assignment with assign()
  • Composing nested components and a compound tabs element

After this module you can

  • Build a component with a default slot, two named slots and fallback content, and predict where each child lands.
  • React to slot content changes using the slotchange event and read assigned nodes with assignedNodes and assignedElements.
  • Coordinate a parent and child elements across shadow boundaries using slots and events, building a tab-list with tab and panel children.
05Events and forms6 lessons, 3 to 4 hours

Lessons

  • Dispatching CustomEvent with detail, bubbles and composed
  • Event retargeting and composedPath
  • Listener ownership and cleanup with AbortController
  • Form-associated elements and setFormValue
  • Constraint validation with setValidity
  • Form callbacks: association, reset, disabled and state restore

After this module you can

  • Dispatch a CustomEvent from inside a shadow root and decide the bubbles and composed flags so a document listener receives it.
  • Predict event.target at different listener positions and read composedPath for open and closed roots.
  • Implement formResetCallback, formDisabledCallback and formStateRestoreCallback and log when each runs.
06Styling and accessibility6 lessons, 3 to 4 hours

Lessons

  • Theming through CSS custom properties
  • Exposing shadow elements with part and exportparts
  • Custom states with ElementInternals.states and :state()
  • Default accessibility semantics through ElementInternals
  • ARIA relationships across shadow boundaries
  • Focus delegation and keyboard operation

After this module you can

  • Expose three documented custom properties with defaults and show a page theme overriding them from outside the shadow root.
  • Mark inner elements with part and style them from the page using ::part, and re-export parts through a nested component with exportparts.
  • Use delegatesFocus and roving tabindex so a composite control has one tab stop and is fully keyboard operable.
07Framework interoperability5 lessons, 2 to 4 hours

Lessons

  • How frameworks pass data: attribute-or-property decision table
  • React: props, events and the on-prefix
  • Vue and Svelte hosts: modifiers, compiler options and events
  • Designing a framework-friendly public API
  • An interoperability test matrix across hosts

After this module you can

  • Fill a decision table of how React, Vue, Svelte and Angular bind a value to a custom element, using the Custom Elements Everywhere results and the framework docs.
  • Wire a custom element in a React host so an array property is passed and a custom event with a dash is handled.
  • Write a Playwright matrix that renders the same element in plain HTML, a property-setting host and an attribute-only host and compares the observable results.
08Component packaging5 lessons, 2 to 4 hours

Lessons

  • Module layout and safe registration
  • Authoring with Lit versus vanilla elements
  • Testing elements in a real browser, and where jsdom falls short
  • Public API surface and versioning
  • Packed-artifact smoke test and release checklist

After this module you can

  • Structure the package as ES modules with exported classes and an opt-in define function that tolerates being loaded twice.
  • Re-implement one element with Lit 3 reactive properties and html templates and compare code size, render behaviour and dependency cost with the vanilla version.
  • Pack the library, install the tarball into a clean project, run the demo and tests against the installed copy and record the checklist results.

What you'll build

3 guided projects along the way, then a final project.

  • A themeable, encapsulated card element

    after module 3
  • Compound tabs and a form-associated rating

    after module 5
  • Accessible, framework-neutral kit with an interop matrix

    after module 7

Final project

Accessible reusable custom-element library with interoperability tests. Choose one option: Accessible form-control kit; Navigation kit; Data-display kit.

What you submit

Source and packed-artifact submission (tarball file list and clean-install smoke test).

How it's reviewed

Trainer review against the rubric: Standards correctness: constructor, lifecycle, shadow and form rules followed (25%) Accessibility evidence: role-name locators, snapshots, keyboard sequence (25%).

Where you'll use it

  • Build a shared form control, such as a rating or tag input, that several teams can use in different frameworks.
  • Package and document a component kit so other developers can install and smoke-test it.

Roles that use these skills

  • Front-end developer
  • Design system engineer
  • UI engineer

Earn the certificate by building, not watching

  1. Complete the lessons and pass each module checkpoint.
  2. Build your final project and demonstrate it.
  3. OUTLEARN reviews your project and issues your certificate. It is not issued automatically.

Frequently asked questions

What do I need before I start?

Prerequisite courses: Web Foundations: HTML, CSS and Responsive Layouts, JavaScript DOM & Browser APIs. Entry requirements: Web Foundations (HTML, CSS, forms, semantic structure) and JavaScript DOM & Browser APIs. Diagnostic check: the learner can write a page that selects elements with querySelector, adds a delegated click listener, reads a form with FormData and explains the cascade for a class selector. A learner without the earlier course meets Playwright through a supplied starter harness; the earlier course is reused by reference, not retaught. Shadow DOM, custom elements and templates are first taught here.

Do I get a certificate?

We do not issue certificates until you successfully build and demonstrate your live project. Module and final assessments are planned; the module pass rule is proposed, not final. Certificates are issued by OUTLEARN staff; nothing is issued automatically.

What do I build at the end?

Accessible reusable custom-element library with interoperability tests. Choose one option: Accessible form-control kit; Navigation kit; Data-display kit.

Be first in when Web Components opens

Email us and we will tell you as soon as enrolment opens.

Notify me when it opens
₹39Opens soon
Notify me