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
120
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
100
Harmony with ES6!
gnumanth
6
1.2k
Ants and Algorithm
gnumanth
1
130
NoSQL?
gnumanth
2
260
Google's whitepaper
gnumanth
3
150
Python Intro
gnumanth
1
390
Other Decks in Programming
See All in Programming
What's New in Web AI?
christianliebel
PRO
0
120
Claude Code on the Web を超える!? Codex Cloud の実践テク5選
sunagaku
0
460
CSC509 Lecture 11
javiergs
PRO
0
300
Kotlinで実装するCPU/GPU 「協調的」パフォーマンス管理
matuyuhi
0
360
ネストしたdata classの面倒な更新にさようなら!Lensを作って理解するArrowのOpticsの世界
shiita0903
1
290
競馬で学ぶ機械学習の基本と実践 / Machine Learning with Horse Racing
shoheimitani
0
160
Register is more than clipboard
satorunooshie
1
450
Flutterアプリ運用の現場で役立った監視Tips 5選
ostk0069
1
310
Blazing Fast UI Development with Compose Hot Reload (Bangladesh KUG, October 2025)
zsmb
2
500
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
410
高単価案件で働くための心構え
nullnull
0
100
AI POSにおけるLLM Observability基盤の導入 ― サイバーエージェントDXインターン成果報告
hekuchan
0
470
Featured
See All Featured
Done Done
chrislema
186
16k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8k
RailsConf 2023
tenderlove
30
1.3k
How GitHub (no longer) Works
holman
315
140k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6k
The Invisible Side of Design
smashingmag
302
51k
Facilitating Awesome Meetings
lara
57
6.6k
Mobile First: as difficult as doing things right
swwweet
225
10k
Documentation Writing (for coders)
carmenintech
76
5.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
We Have a Design System, Now What?
morganepeng
54
7.9k
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