The Problem
Why do we even need Web Components?
Underpinning Technology
Core browser API's underlying Web Components
Demo
Converting a button to a Web Component
1
2
3
The Problem
Why do we even need Web Components?
Technology
Core browser API's underlying Web Components
Demo
Converting a button to a Web Component
1
2
3
The Problem
Why do we even need Web Components?
Technology
Core browser API's underlying Web Components
Demo
Converting a button to a Web Component
1
2
3
The Problem
Why do we even need Web Components?
Technology
Core browser API's underlying Web Components
Demo
Writing some Web Component code
1
2
3
The Problem
Why do we even need Web Components?
Technology
Core browser API's underlying Web Components
Demo
Converting a button to a Web Component
1
2
3
The Problem
Why do we even need Web Components?
Technology
Core browser API's underlying Web Components
Demo
Converting a button to a Web Component
1
2
3
"What we need to remember, though, is that the Web, as we know it now, is a fleeting thing. [...] The Web will be understood not as screenfuls of text and graphics but as a transport mechanism, the ether through which interactivity happens."
Darcy DiNucci
Print Magazine (1999)
Custom Elements
HTML Templates
Shadow DOM
Custom Elements
HTML Templates
Shadow DOM
Custom Elements
HTML Templates
Shadow DOM
Custom Elements
HTML Templates
Shadow DOM
Custom Elements
HTML Templates
Shadow DOM
Custom Elements
HTML Templates
Shadow DOM
ES Modules
Constructable Style Sheets
Custom Elements
HTML Templates
Shadow DOM
ES Modules
Constructable Style Sheets
Custom Elements
HTML Templates
Shadow DOM
ES Modules
Constructable Style Sheets
1. Custom Elements
3. ES Modules
2. Shadow DOM
<div>Hello World!</div>
<div>Hello World!</div>
document
.createElement('div')
.appendChild(document.createTextNode('Hello World'))
1. Custom Elements
3. ES Modules
2. Shadow DOM
<my-element>Hello World</my-element>
1. Custom Elements
3. ES Modules
2. Shadow DOM
<my-element>Hello World</my-element>
1. Custom Elements
3. ES Modules
2. Shadow DOM
1. Custom Elements
3. ES Modules
2. Shadow DOM
<my-element>Hello World</my-element>
class MyComponent extends HTMLElement {
constructor() { super() }
}
1. Custom Elements
3. ES Modules
2. Shadow DOM
1. Custom Elements
3. ES Modules
2. Shadow DOM
1. Custom Elements
3. ES Modules
2. Shadow DOM
1. Custom Elements
3. ES Modules
2. Shadow DOM
1. Custom Elements
3. ES Modules
2. Shadow DOM
1. Custom Elements
3. ES Modules
2. Shadow DOM
1. Custom Elements
3. ES Modules
2. Shadow DOM
1. Custom Elements
3. ES Modules
2. Shadow DOM
1. Custom Elements
3. ES Modules
2. Shadow DOM
1. Custom Elements
3. ES Modules
2. Shadow DOM
1. Custom Elements
3. ES Modules
2. Shadow DOM
1. Custom Elements
3. ES Modules
2. Shadow DOM
1. Custom Elements
3. ES Modules
2. Shadow DOM
import HelloWorld from './hello-world.js';
import { Hello, World } from './hello-world.js';
1. Custom Elements
3. ES Modules
2. Shadow DOM
project/
├── utilities/
│ ├── base-component.js
│ └── base-view-component.js
├── components/
│ ├── custom-button.js
│ ├── custom-icon.js
│ ├── mobile-menu.js
│ ├── user-card.js
│ └── data-table.js
└── views/
├── landing-page.js
├── user-settings.js
└── list-of-items.js
1. Custom Elements
3. ES Modules
2. Shadow DOM