Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Web Components v1
Search
hemanth.hm
April 13, 2017
Programming
1
130
Web Components v1
Quick intro to Web Components v1
hemanth.hm
April 13, 2017
Tweet
Share
More Decks by hemanth.hm
See All by hemanth.hm
Rethink Async
gnumanth
1
110
Harmony with ES6!
gnumanth
6
1.2k
Ants and Algorithm
gnumanth
1
130
NoSQL?
gnumanth
2
260
Google's whitepaper
gnumanth
3
160
Python Intro
gnumanth
1
390
Other Decks in Programming
See All in Programming
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
Implementation Patterns
denyspoltorak
0
280
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
670
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
CSC307 Lecture 05
javiergs
PRO
0
500
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
Architectural Extensions
denyspoltorak
0
280
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
6k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
520
Featured
See All Featured
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
84
Discover your Explorer Soul
emna__ayadi
2
1.1k
The Curse of the Amulet
leimatthew05
1
8.3k
Writing Fast Ruby
sferik
630
62k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
Java REST API Framework Comparison - PWX 2021
mraible
34
9.1k
Designing for Performance
lara
610
70k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
160
Git: the NoSQL Database
bkeepers
PRO
432
66k
Designing for humans not robots
tammielis
254
26k
Color Theory Basics | Prateek | Gurzu
gurzu
0
190
Become a Pro
speakerdeck
PRO
31
5.8k
Transcript
Web Componentes
· <template> tag · HTML imports · Shadow DOM ·
Custom Elements
<template>
'content' in document.createElement('template');
Activating <template>: var t = document.querySelector('#aweTemplate'); var clone = document.importNode(t.content,
true); document.body.appendChild(clone);
DEMO
HTML imports
'import' in document.createElement('link');
<link rel="import" href="/imports/aweTemplate.html"> <link rel="import" href="/imports/aweTemplate.html" onload="handleLoad(event)" onerror="handleError(event)">
const link = document.querySelector('link[rel=import]'); const xkcd = link.import; // Access
DOM of the document in aweTemplate const cartoon = xkcd.querySelector('img');
const aweDoc = document.currentScript.ownerDocument;
DEMO
Shadow DOM
const supportsShadowDOMV1 = !!HTMLElement.prototype.attachShadow;
const host = document.body.createShadowRoot(); host.innerHTML = "<p>I'm a <em>shadow</em> dom!</p>";
document.appendChild(host);
DEMO
Custom Elements
const supportsCustomElements = 'customElements' in window;
class AweElement extends HTMLElement {...} window.customElements.define('awe-element', AppDrawer);
window.customElements.define('awe-element', class extends HTMLElement {...});
class AweElement extends HTMLElement { constructor() { super(); // Don't
forget ... } connectedCallback() { ... } disconnectedCallback() { ... } attributeChangedCallback(attrName, oldVal, newVal) { ... } }
None
DEMO
None
None
h3manth.com @gnumanth
None