| 1 |
|
| 2 |
<!doctype html> |
| 3 |
|
| 4 |
<html lang="en"> |
| 5 |
<head> |
| 6 |
<meta charset="utf-8"> |
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 8 |
<title><my-element> ⌲ Home</title> |
| 9 |
<link rel="stylesheet" href="docs.css"> |
| 10 |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600|Roboto+Mono"> |
| 11 |
<link href="prism-okaidia.css" rel="stylesheet" /> |
| 12 |
<script src="/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script> |
| 13 |
<script src="/node_modules/lit/polyfill-support.js"></script> |
| 14 |
<script type="module" src="my-element.bundled.js"></script> |
| 15 |
</head> |
| 16 |
<body> |
| 17 |
|
| 18 |
<header> |
| 19 |
<h1><my-element></h1> |
| 20 |
<h2>A web component just for me.</h2> |
| 21 |
</header> |
| 22 |
|
| 23 |
<nav> |
| 24 |
<a href="">Home</a> |
| 25 |
<a href="examples/">Examples</a> |
| 26 |
<a href="api/">API</a> |
| 27 |
<a href="install/">Install</a> |
| 28 |
</nav> |
| 29 |
<div id="main-wrapper"> |
| 30 |
<main> |
| 31 |
<h1><my-element></h1> |
| 32 |
<p><code><my-element></code> is an awesome element. It's a great introduction to building web components with LitElement, with nice documentation site as well.</p> |
| 33 |
<h2>As easy as HTML</h2> |
| 34 |
<section class="columns"> |
| 35 |
<div> |
| 36 |
<p><code><my-element></code> is just an HTML element. You can it anywhere you can use HTML!</p> |
| 37 |
<pre class="language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>my-element</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>my-element</span><span class="token punctuation">></span></span></code></pre> |
| 38 |
</div> |
| 39 |
<div> |
| 40 |
<p><my-element></my-element></p> |
| 41 |
</div> |
| 42 |
</section> |
| 43 |
<h2>Configure with attributes</h2> |
| 44 |
<section class="columns"> |
| 45 |
<div> |
| 46 |
<p><code><my-element></code> can be configured with attributed in plain HTML.</p> |
| 47 |
<pre class="language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>my-element</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>HTML<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>my-element</span><span class="token punctuation">></span></span></code></pre> |
| 48 |
</div> |
| 49 |
<div> |
| 50 |
<p><my-element name="HTML"></my-element></p> |
| 51 |
</div> |
| 52 |
</section> |
| 53 |
<h2>Declarative rendering</h2> |
| 54 |
<section class="columns"> |
| 55 |
<div> |
| 56 |
<p><code><my-element></code> can be used with declarative rendering libraries like Angular, React, Vue, and lit-html</p> |
| 57 |
<pre class="language-js"><code class="language-js"><span class="token keyword">import</span> <span class="token punctuation">{</span>html<span class="token punctuation">,</span> render<span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'lit-html'</span><span class="token punctuation">;</span><br><br><span class="token keyword">const</span> name <span class="token operator">=</span> <span class="token string">'lit-html'</span><span class="token punctuation">;</span><br><br><span class="token function">render</span><span class="token punctuation">(</span><br> html<span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string"><br> <h2>This is a &lt;my-element&gt;</h2><br> <my-element .name=</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>name<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">></my-element><br> </span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span><br> document<span class="token punctuation">.</span>body<br><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre> |
| 58 |
</div> |
| 59 |
<div> |
| 60 |
<h2>This is a <my-element></h2> |
| 61 |
<my-element name="lit-html"></my-element> |
| 62 |
</div> |
| 63 |
</section> |
| 64 |
|
| 65 |
</main> |
| 66 |
</div> |
| 67 |
|
| 68 |
<footer> |
| 69 |
<p> |
| 70 |
Made with |
| 71 |
<a href="https://github.com/lit/lit-element-starter-js">lit-starter-js</a> |
| 72 |
</p> |
| 73 |
</footer> |
| 74 |
</body> |
| 75 |
</html> |