SlideShare a Scribd company logo
Web Components 
Jeff Tapper 
Digital Primates 
@jefftapper / @digitalprimates
Who am I? 
• Senior Consultant at Digital Primates 
– Building next generation client applications 
• Developing Internet applications for 19 years 
• Author of 12 books on Internet technologies
Who are you?
What are Web Components? 
Web Components are an attempt to let 
you write custom components that can be 
used like this: 
<body> 
Sales:<br> 
<my-super-cool-chart id="coolChart"> 
</ my-super-cool-chart > 
</body>
What is Polymer? 
A library built on top of Web Components. 
Allows us to use Web Components today in modern browsers 
which don’t yet support Web Components 
3 main pieces 
• A set of polyfills 
• Web application framework 
• Set of UI components
What are we covering? 
Web Components, specifically: 
What in the world are web components? 
What problem are they trying to solve? 
How do they work? 
Can I actually use these things? 
What does it mean to my app/development process?
Life on the Edge 
Web Components are beyond leading edge. 
As of this moment, they do not work in their entirety in any 
browser 
A good portion of the functionality is available in Chrome 
Canary if you turn on all of the experimental WebKit and 
JavaScript features
So, is it real? 
Even though Web Components are not fully supported in 
any browser, and are only partially supported in some 
browsers, Polymer and Polyfills allow use in many 
modern browsers today
Where can I use this today?
So why do I care? 
A few minor reasons you may like the idea, first: 
Encapsulation 
• Manageable Reuse 
• Hiding complexity and implementation 
• Dealing with duplicated IDs 
• Dealing with CSS scoping / propagation 
Ease of Distribution 
Appropriate technology choices 
• Markup in markup, not in code
How does it work? 
Web Components are a series of editors draft 
specifications: 
• Shadow DOM 
– http://w3c.github.io/webcomponents/spec/shadow/ 
• Custom Elements 
– http://w3c.github.io/webcomponents/spec/custom/ 
• HTML Imports 
– http://w3c.github.io/webcomponents/spec/imports/
Example Application 
• Let’s look at a sample application built using a 
series of Web Components 
• Combination of custom components, and 
those provided by the polymer-project
Templates 
The concept of templates is prolific and nearly self-explanatory. 
Their use takes a bit more effort: 
Inactive DOM Fragment 
Easily Clone-able 
Easily Change-able
Built In Templates 
You define them with the template element 
<template id="productTemplate"> 
<div> 
<img src=""> 
<div class="name"></div> 
<div class="description"></div> 
</div> 
</template> 
This is parsed but it’s not active. It’s not rendered.
Shadow DOM 
Shadow DOM is at the heart of the whole component 
concepts 
It’s encapsulation 
Its used by the browsers today to implement their own 
controls 
Ultimately its about hiding implementation details and 
exposing an interface
Shadow DOM 
The name and the technical explanation 
sometimes get in the way of the concept. 
Put simply, the user sees this: 
Photo by Photo by: Mark Kaelin/TechRepublic
Shadow DOM 
The browser sees this: 
Photo by Photo by: Mark Kaelin/TechRepublic
Shadow Host/Root
Rendering
Styles 
The Shadow also forms a boundary. Styles don’t cross 
unless you let them. So you to keep control of this area
Styles 
This, by default, goes both ways… meaning we aren’t 
worried about collisions. 
Outside styles don’t 
affect shadow content 
Styles defined in here 
are scoped locally
HTML Imports 
• HTML imports are about importing and sharing HTML 
content. 
• Why? Well, reuse, it facilitates the reuse of templates 
and provides us a fundamental need if we are going to 
share an encapsulated chunk we might call a 
component. 
• <link rel="import" href="goodies.html">
HTML Imports 
• Last word on this… 
• Imports aren’t supported pretty much anywhere yet, 
however, there are polyfills. 
• Imports are blocking. So, your page will act as though it 
needs this content before it can render.
Custom Elements 
• Elements are the key to putting this together. 
• Custom Elements are DOM elements that can be 
defined by a developer. 
• They are allowed to manage state and provide a 
scriptable interface. 
• In other words, they are the shell of what will become 
our component
Custom Elements 
• Defining a custom element like this: 
<polymer-element extends="button" name="fancy-button"> 
</polymer-element> 
• Allows you to use that custom element in your 
own markup: 
<div> 
<fancy-button></fancy-button> 
</div>
Custom Elements 
• You can use the concepts we previously discussed, 
templates, Shadow DOM, etc. from within a custom 
element. 
• Further, custom elements give you a set of Lifecycle 
callbacks so you can know things like when you are 
inserted into the DOM, removed and ready. 
• This means you can define the visual aspects of a 
custom element in mark up and the code in script.
Resources 
• http://www.w3.org/wiki/WebComponents/ 
• http://www.polymer-project.org/ 
• @polymer – officical twitter of the polymer 
project 
• @digitalprimates 
• @jefftapper

More Related Content

PPTX
Dspace configuration on XMLUI DSpace
PPTX
Data center design 2
PDF
Data Center Floor Design - Your Layout Can Save of Kill Your PUE & Cooling Ef...
PPTX
Tailwind CSS.11.pptx
PPTX
PPTX
Implement SQL Server on an Azure VM
PDF
Microsoft Azure VM Cheat Sheet
PPTX
Storage Basics
Dspace configuration on XMLUI DSpace
Data center design 2
Data Center Floor Design - Your Layout Can Save of Kill Your PUE & Cooling Ef...
Tailwind CSS.11.pptx
Implement SQL Server on an Azure VM
Microsoft Azure VM Cheat Sheet
Storage Basics

What's hot (10)

PPTX
Enterprise Service Bus
PPTX
HBase Operations and Best Practices
PDF
Web Components
PPTX
Azure BCDR in Action: From Setup to Failover and Back
PDF
Data center Building & General Specification
PPT
NoSQL databases
PDF
What's New In Apache CloudStack 4.17
KEY
Amazon's Simple Storage Service (S3)
PDF
Azure 10 major services
Enterprise Service Bus
HBase Operations and Best Practices
Web Components
Azure BCDR in Action: From Setup to Failover and Back
Data center Building & General Specification
NoSQL databases
What's New In Apache CloudStack 4.17
Amazon's Simple Storage Service (S3)
Azure 10 major services
Ad

Viewers also liked (19)

PPT
Intensivo 80h - Links Patrocinados
PPT
Website Design & Web History Presentation Add By Upul Chanaka
PPT
Publishing Your Family History to the Web - Version 3
PPTX
Cloud Services with Doteasy.com
PPTX
A concept for a web browser
PPT
Context And Concept Of Web Services
PPTX
Internet infrastructure
PPTX
Sensex Sep 2015
PPTX
Emerging payment technologies
PDF
The Web: history - now - future
PDF
Internet infrastructure and the history of the world wide web presentation, f...
PDF
Web Workflow
PPTX
Hardware for a_soft_world_bkup
PDF
The Little Shop of TDD Horrors
PDF
Upgrading the Web with Douglas Crockford @ FITC's Web Unleashed 2015
PDF
Goofy, Goodfellas and a Gardener: The Masters of Experience Design.
PPTX
21st Century Crystal Ball
PDF
Everydays
PPTX
The Future of Motion/Gesture Technology
Intensivo 80h - Links Patrocinados
Website Design & Web History Presentation Add By Upul Chanaka
Publishing Your Family History to the Web - Version 3
Cloud Services with Doteasy.com
A concept for a web browser
Context And Concept Of Web Services
Internet infrastructure
Sensex Sep 2015
Emerging payment technologies
The Web: history - now - future
Internet infrastructure and the history of the world wide web presentation, f...
Web Workflow
Hardware for a_soft_world_bkup
The Little Shop of TDD Horrors
Upgrading the Web with Douglas Crockford @ FITC's Web Unleashed 2015
Goofy, Goodfellas and a Gardener: The Masters of Experience Design.
21st Century Crystal Ball
Everydays
The Future of Motion/Gesture Technology
Ad

Similar to Web Components (20)

PPTX
Web Components
PPT
Reaching for the Future with Web Components and Polymer
PPTX
Web components, so close!
PDF
PDF
Introduction to Web Components
PPTX
Implementing Vanilla Web Components
PDF
Implementing a Symfony Based CMS in a Publishing Company
PPTX
PPT
1_Intro_toHTML.ppt
PDF
Web Development with Delphi and React - ITDevCon 2016
PPT
SDWest2005Goetsch
PDF
Webcomponents TLV October 2014
PPTX
O365 Developer Bootcamp NJ 2018 - Material
PPTX
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
PDF
Web components are the future of the web - Take advantage of new web technolo...
PDF
Introduction to Web Components & Polymer Workshop - JS Interactive
PDF
Webcomponents v2
PDF
Web component driven development
PPTX
Angular Ivy- An Overview
PDF
IRJET- Polymer Javascript
Web Components
Reaching for the Future with Web Components and Polymer
Web components, so close!
Introduction to Web Components
Implementing Vanilla Web Components
Implementing a Symfony Based CMS in a Publishing Company
1_Intro_toHTML.ppt
Web Development with Delphi and React - ITDevCon 2016
SDWest2005Goetsch
Webcomponents TLV October 2014
O365 Developer Bootcamp NJ 2018 - Material
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
Web components are the future of the web - Take advantage of new web technolo...
Introduction to Web Components & Polymer Workshop - JS Interactive
Webcomponents v2
Web component driven development
Angular Ivy- An Overview
IRJET- Polymer Javascript

More from FITC (20)

PPTX
Cut it up
PDF
Designing for Digital Health
PDF
Profiling JavaScript Performance
PPTX
Surviving Your Tech Stack
PDF
How to Pitch Your First AR Project
PDF
Start by Understanding the Problem, Not by Delivering the Answer
PDF
Cocaine to Carrots: The Art of Telling Someone Else’s Story
PDF
Everyday Innovation
PDF
HyperLight Websites
PDF
Everything is Terrifying
PDF
Post-Earth Visions: Designing for Space and the Future Human
PDF
The Rise of the Creative Social Influencer (and How to Become One)
PDF
East of the Rockies: Developing an AR Game
PDF
Creating a Proactive Healthcare System
PDF
World Transformation: The Secret Agenda of Product Design
PDF
The Power of Now
PDF
High Performance PWAs
PDF
Rise of the JAMstack
PDF
From Closed to Open: A Journey of Self Discovery
PDF
Projects Ain’t Nobody Got Time For
Cut it up
Designing for Digital Health
Profiling JavaScript Performance
Surviving Your Tech Stack
How to Pitch Your First AR Project
Start by Understanding the Problem, Not by Delivering the Answer
Cocaine to Carrots: The Art of Telling Someone Else’s Story
Everyday Innovation
HyperLight Websites
Everything is Terrifying
Post-Earth Visions: Designing for Space and the Future Human
The Rise of the Creative Social Influencer (and How to Become One)
East of the Rockies: Developing an AR Game
Creating a Proactive Healthcare System
World Transformation: The Secret Agenda of Product Design
The Power of Now
High Performance PWAs
Rise of the JAMstack
From Closed to Open: A Journey of Self Discovery
Projects Ain’t Nobody Got Time For

Recently uploaded (20)

PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PDF
Triggering QUIC, presented by Geoff Huston at IETF 123
PDF
The Internet -By the Numbers, Sri Lanka Edition
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PDF
Paper PDF World Game (s) Great Redesign.pdf
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PPTX
Funds Management Learning Material for Beg
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPTX
Introduction to Information and Communication Technology
PDF
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
PPTX
artificial intelligence overview of it and more
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
The New Creative Director: How AI Tools for Social Media Content Creation Are...
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
Decoding a Decade: 10 Years of Applied CTI Discipline
Design_with_Watersergyerge45hrbgre4top (1).ppt
An introduction to the IFRS (ISSB) Stndards.pdf
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
Triggering QUIC, presented by Geoff Huston at IETF 123
The Internet -By the Numbers, Sri Lanka Edition
Tenda Login Guide: Access Your Router in 5 Easy Steps
Paper PDF World Game (s) Great Redesign.pdf
Module 1 - Cyber Law and Ethics 101.pptx
Funds Management Learning Material for Beg
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
Job_Card_System_Styled_lorem_ipsum_.pptx
Introduction to Information and Communication Technology
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
artificial intelligence overview of it and more

Web Components

  • 1. Web Components Jeff Tapper Digital Primates @jefftapper / @digitalprimates
  • 2. Who am I? • Senior Consultant at Digital Primates – Building next generation client applications • Developing Internet applications for 19 years • Author of 12 books on Internet technologies
  • 4. What are Web Components? Web Components are an attempt to let you write custom components that can be used like this: <body> Sales:<br> <my-super-cool-chart id="coolChart"> </ my-super-cool-chart > </body>
  • 5. What is Polymer? A library built on top of Web Components. Allows us to use Web Components today in modern browsers which don’t yet support Web Components 3 main pieces • A set of polyfills • Web application framework • Set of UI components
  • 6. What are we covering? Web Components, specifically: What in the world are web components? What problem are they trying to solve? How do they work? Can I actually use these things? What does it mean to my app/development process?
  • 7. Life on the Edge Web Components are beyond leading edge. As of this moment, they do not work in their entirety in any browser A good portion of the functionality is available in Chrome Canary if you turn on all of the experimental WebKit and JavaScript features
  • 8. So, is it real? Even though Web Components are not fully supported in any browser, and are only partially supported in some browsers, Polymer and Polyfills allow use in many modern browsers today
  • 9. Where can I use this today?
  • 10. So why do I care? A few minor reasons you may like the idea, first: Encapsulation • Manageable Reuse • Hiding complexity and implementation • Dealing with duplicated IDs • Dealing with CSS scoping / propagation Ease of Distribution Appropriate technology choices • Markup in markup, not in code
  • 11. How does it work? Web Components are a series of editors draft specifications: • Shadow DOM – http://w3c.github.io/webcomponents/spec/shadow/ • Custom Elements – http://w3c.github.io/webcomponents/spec/custom/ • HTML Imports – http://w3c.github.io/webcomponents/spec/imports/
  • 12. Example Application • Let’s look at a sample application built using a series of Web Components • Combination of custom components, and those provided by the polymer-project
  • 13. Templates The concept of templates is prolific and nearly self-explanatory. Their use takes a bit more effort: Inactive DOM Fragment Easily Clone-able Easily Change-able
  • 14. Built In Templates You define them with the template element <template id="productTemplate"> <div> <img src=""> <div class="name"></div> <div class="description"></div> </div> </template> This is parsed but it’s not active. It’s not rendered.
  • 15. Shadow DOM Shadow DOM is at the heart of the whole component concepts It’s encapsulation Its used by the browsers today to implement their own controls Ultimately its about hiding implementation details and exposing an interface
  • 16. Shadow DOM The name and the technical explanation sometimes get in the way of the concept. Put simply, the user sees this: Photo by Photo by: Mark Kaelin/TechRepublic
  • 17. Shadow DOM The browser sees this: Photo by Photo by: Mark Kaelin/TechRepublic
  • 20. Styles The Shadow also forms a boundary. Styles don’t cross unless you let them. So you to keep control of this area
  • 21. Styles This, by default, goes both ways… meaning we aren’t worried about collisions. Outside styles don’t affect shadow content Styles defined in here are scoped locally
  • 22. HTML Imports • HTML imports are about importing and sharing HTML content. • Why? Well, reuse, it facilitates the reuse of templates and provides us a fundamental need if we are going to share an encapsulated chunk we might call a component. • <link rel="import" href="goodies.html">
  • 23. HTML Imports • Last word on this… • Imports aren’t supported pretty much anywhere yet, however, there are polyfills. • Imports are blocking. So, your page will act as though it needs this content before it can render.
  • 24. Custom Elements • Elements are the key to putting this together. • Custom Elements are DOM elements that can be defined by a developer. • They are allowed to manage state and provide a scriptable interface. • In other words, they are the shell of what will become our component
  • 25. Custom Elements • Defining a custom element like this: <polymer-element extends="button" name="fancy-button"> </polymer-element> • Allows you to use that custom element in your own markup: <div> <fancy-button></fancy-button> </div>
  • 26. Custom Elements • You can use the concepts we previously discussed, templates, Shadow DOM, etc. from within a custom element. • Further, custom elements give you a set of Lifecycle callbacks so you can know things like when you are inserted into the DOM, removed and ready. • This means you can define the visual aspects of a custom element in mark up and the code in script.
  • 27. Resources • http://www.w3.org/wiki/WebComponents/ • http://www.polymer-project.org/ • @polymer – officical twitter of the polymer project • @digitalprimates • @jefftapper