Turbo Vision (text base UI control set)
Visual InterDev (calendar component)
</div> </div> </div> </div> </div> </div> </div> </div>Probably a twitter bootstrap page
Current developers' experience in reusing widgets is really poor
<iframe src="foo.htm"></iframe>
<template id="foo"> <img src="img.png" alt="image"> <h1>Hello World</h1> </template> <div id="container"> </div>
var template = document.querySelector('#foo'); var container = document.querySelector('#container'); var clone = document.importNode(template.content, true); //Creating shadow root and appending cloned template var root = container.createShadowRoot(); root.appendChild(clone);
//To check if browser support native template if ('content' in document.createElement('template')){ }Note: Default template implementation doesn't come with if, repeat Server side / Client side
Native browser suport
Inert
<stack-question favored="true" rank="3"> <h1>How do I use WebComponent in my HTML page</h1> <stack-comment>Comment 2</stack-comment> <stack-comment>Comment 2</stack-comment> <stack-answer rank="3" answer="true">Asnwer 1 <stack-comment>Commnet 3</stack-comment> </stack-answer> </stack-question>
var XFavButton = document.registerElement('stack-favorite-button'); document.body.appendChild(new XFavButton());
Or
var XFavButton = document.registerElement('stack-favorite-button',{ prototype: Object.create(HTMLButtonElement.prototype), extends: 'button' } ); document.body.appendChild(new XFavButton());
javascript..... <script/>
image.......... <img/>
css............ <link/>
video.......... <video/>
HTML........... ????
<head> <link rel="import" href="/path/to/imports/stuff.html"> </head>
<script> var link = document.querySelector('link[rel="import"]'); var content = link.import; // Clone the <template> in the import. var template = content.querySelector('template'); var clone = document.importNode(template.content, true); document.querySelector('#container').appendChild(clone); </script>
What does community do with in-progress standard?
Webcomponentjs
bower install --save webcomponentsjs
Includes all polyfills except for shadow DOM.