CourseFREE · SELF-PACED

Web Components from scratch

From your first custom element to a fully encapsulated, themeable component library — no build tools, no framework, start to finish. Nine lessons that leave you fluent in the platform.

  • 9 lessons
  • ~4 hours
  • No build tools
  • Beginner → Intermediate

Define real custom elements

Lifecycle, attributes, and properties — the parts of the platform every framework wraps.

Encapsulate with Shadow DOM

Styles and markup that can't leak or be leaked into — with slots for composition.

Theme without a framework

Custom properties and ::part to skin a whole library from one sheet.


01 Curriculum

Nine lessons, start to ship

  1. Your first custom elementFree preview

    customElements.define, the four lifecycle callbacks, and a working element in ten lines.

    22 min →
  2. The Shadow DOM

    Attach a shadow root, understand encapsulation, and project light DOM with slots.

    26 min
  3. Templates & efficient rendering

    Use <template> and cloneNode to render once and update cheaply — no innerHTML thrash.

    24 min
  4. Attributes, properties & reflection

    observedAttributes, attributeChangedCallback, and keeping the two in sync the right way.

    28 min
  5. Events & communication

    Custom events, bubbling and the composed flag — how components talk across shadow boundaries.

    25 min
  6. Styling & theming

    :host, ::part and custom properties — skin an entire component set from one token sheet.

    30 min
  7. State without a framework

    Wire a tiny reactive core into your elements — the 25-line signals engine from the lab.

    27 min
  8. Composition & patterns

    Build components out of components, lean on slots, and avoid the traps that bite at scale.

    26 min
  9. Shipping a component library

    Package, version, and document your set so any project — framework or not — can drop it in.

    32 min

02 Before you start

What you'll need

  • Comfortable JavaScript. Functions, classes, and the DOM. No TypeScript required.

  • A browser and a text editor. That's the whole toolchain — no Node, no bundler, no install step.

  • No framework experience. If you know React, great; if you don't, even better — fewer habits to unlearn.


Taught by the Terrarium Labs team

The same people who ship web components in production. Free, self-paced, yours to keep.

Start lesson 1 →