You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44-16Lines changed: 44 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,29 +18,57 @@ Insert screenshot of a demo page, including a code snippet.
18
18
19
19
> Note: This guide assumes you have npm installed locally.
20
20
21
-
To get started using one of the Material Web Components in your web application, simply:
21
+
The easiest way to try out the Material Web Components is to use one of these online tools:
22
22
23
-
1. Install each element you'd like to use:
23
+
* Runs in all [supported browsers](#browser-support): [Glitch](https://glitch.com/edit/#!/material-web-components)
24
24
25
-
```
26
-
npm install @material/mwc-button
27
-
```
25
+
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/gitufet/edit?html,output), [CodePen](https://codepen.io/sorvell/pen/MGrZqp?editors=1000).
28
26
29
-
1. Load the webcomponents polyfills (see the [webcomponents polyfill readme](https://github.com/webcomponents/webcomponentsjs/blob/v2/README.md) for more info).
27
+
Or you can also copy [this HTML file](https://gist.githubusercontent.com/sorvell/2ec11ccde449815bc97edc1026be27a9/raw/8bab65dd5d15f657ae69493851690c5564367d13/index.html) into a local file and run it in any browser that supports JavaScript Modules.
30
28
31
-
1. Import the element:
29
+
When you're ready to use the Material Web Components in your web application:
32
30
33
-
```html
34
-
<script type="module">
35
-
import {Button} from '@material/mwc-button';
36
-
</script>
37
-
```
31
+
1. Ensure the webcomponents polyfills are included in your HTML page
1. Create an instance of element in your HTML page, or via any framework that [supports rendering Custom Elements](https://custom-elements-everywhere.com/):
1. Run the development server and open a browser pointing to its URL:
62
+
63
+
```polymer serve```
64
+
65
+
> The Material Web Components are published on [npm](https://www.npmjs.com) using JavaScript Modules.
66
+
This means it can take advantage of the standard native JavaScript module loader available in all current major browsers.
67
+
>
68
+
> However, since the Material Web Components use npm convention to reference dependencies by name, a light transform to rewrite specifiers to URLs is required to get it to run in the browser. The polymer-cli's development server `polymer serve` automatically handles this transform.
69
+
70
+
Tools like [WebPack](https://webpack.js.org/) and [Rollup](https://rollupjs.org/) can also be used to serve and/or bundle.
Copy file name to clipboardExpand all lines: packages/button/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,11 @@ A [Material Components](https://material.io/components/) icon implementation usi
3
3
4
4
## Getting started
5
5
6
-
* The easiest way to try out mwc-button is to use one of these online tools:
6
+
* The easiest way to try out mwc-button is to use one of these online tools:
7
7
8
-
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
8
+
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
9
9
10
-
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
10
+
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
11
11
[CodePen](https://codepen.io/azakus/pen/deZLja).
12
12
13
13
* You can also copy [this HTML file](https://gist.githubusercontent.com/azakus/f01e9fc2ed04e781ad5a52ded7b296e7/raw/266f2f4f91cbfe89b2acc6ec63957b1a3cfe9b39/index.html) into a local file and run it in any browser that supports [JavaScript Modules]((https://caniuse.com/#search=modules)).
@@ -42,7 +42,7 @@ A [Material Components](https://material.io/components/) icon implementation usi
42
42
43
43
1. Install the Polymer CLI:
44
44
45
-
```npm i -g polymer-cli@next```
45
+
```npm i -g polymer-cli```
46
46
47
47
1. Run the development server and open a browser pointing to its URL:
Copy file name to clipboardExpand all lines: packages/checkbox/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,10 @@ A [Material Components](https://material.io/components/) icon implementation usi
5
5
6
6
* The easiest way to try out mwc-checkbox is to use one of these online tools:
7
7
8
-
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
8
+
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
9
9
10
-
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
11
-
[CodePen](https://codepen.io/azakus/pen/deZLja).
10
+
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
11
+
[CodePen](https://codepen.io/azakus/pen/deZLja).
12
12
13
13
* You can also copy [this HTML file](https://gist.githubusercontent.com/azakus/f01e9fc2ed04e781ad5a52ded7b296e7/raw/266f2f4f91cbfe89b2acc6ec63957b1a3cfe9b39/index.html) into a local file and run it in any browser that supports [JavaScript Modules]((https://caniuse.com/#search=modules)).
14
14
@@ -42,7 +42,7 @@ A [Material Components](https://material.io/components/) icon implementation usi
42
42
43
43
1. Install the Polymer CLI:
44
44
45
-
```npm i -g polymer-cli@next```
45
+
```npm i -g polymer-cli```
46
46
47
47
1. Run the development server and open a browser pointing to its URL:
Copy file name to clipboardExpand all lines: packages/fab/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,10 @@ A [Material Components](https://material.io/components/) icon implementation usi
5
5
6
6
* The easiest way to try out mwc-fab is to use one of these online tools:
7
7
8
-
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
8
+
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
9
9
10
-
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
11
-
[CodePen](https://codepen.io/azakus/pen/deZLja).
10
+
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
11
+
[CodePen](https://codepen.io/azakus/pen/deZLja).
12
12
13
13
* You can also copy [this HTML file](https://gist.githubusercontent.com/azakus/f01e9fc2ed04e781ad5a52ded7b296e7/raw/266f2f4f91cbfe89b2acc6ec63957b1a3cfe9b39/index.html) into a local file and run it in any browser that supports [JavaScript Modules]((https://caniuse.com/#search=modules)).
14
14
@@ -42,7 +42,7 @@ A [Material Components](https://material.io/components/) icon implementation usi
42
42
43
43
1. Install the Polymer CLI:
44
44
45
-
```npm i -g polymer-cli@next```
45
+
```npm i -g polymer-cli```
46
46
47
47
1. Run the development server and open a browser pointing to its URL:
Copy file name to clipboardExpand all lines: packages/icon/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,10 @@ A [Material Components](https://material.io/components/) icon implementation usi
5
5
6
6
* The easiest way to try out mwc-icon is to use one of these online tools:
7
7
8
-
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
8
+
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
9
9
10
-
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
11
-
[CodePen](https://codepen.io/azakus/pen/deZLja).
10
+
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
11
+
[CodePen](https://codepen.io/azakus/pen/deZLja).
12
12
13
13
* You can also copy [this HTML file](https://gist.githubusercontent.com/azakus/f01e9fc2ed04e781ad5a52ded7b296e7/raw/266f2f4f91cbfe89b2acc6ec63957b1a3cfe9b39/index.html) into a local file and run it in any browser that supports [JavaScript Modules]((https://caniuse.com/#search=modules)).
14
14
@@ -42,7 +42,7 @@ A [Material Components](https://material.io/components/) icon implementation usi
42
42
43
43
1. Install the Polymer CLI:
44
44
45
-
```npm i -g polymer-cli@next```
45
+
```npm i -g polymer-cli```
46
46
47
47
1. Run the development server and open a browser pointing to its URL:
Copy file name to clipboardExpand all lines: packages/radio/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,10 @@ A [Material Components](https://material.io/components/) icon implementation usi
5
5
6
6
* The easiest way to try out mwc-radio is to use one of these online tools:
7
7
8
-
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
8
+
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
9
9
10
-
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
11
-
[CodePen](https://codepen.io/azakus/pen/deZLja).
10
+
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
11
+
[CodePen](https://codepen.io/azakus/pen/deZLja).
12
12
13
13
* You can also copy [this HTML file](https://gist.githubusercontent.com/azakus/f01e9fc2ed04e781ad5a52ded7b296e7/raw/266f2f4f91cbfe89b2acc6ec63957b1a3cfe9b39/index.html) into a local file and run it in any browser that supports [JavaScript Modules]((https://caniuse.com/#search=modules)).
14
14
@@ -42,7 +42,7 @@ A [Material Components](https://material.io/components/) icon implementation usi
42
42
43
43
1. Install the Polymer CLI:
44
44
45
-
```npm i -g polymer-cli@next```
45
+
```npm i -g polymer-cli```
46
46
47
47
1. Run the development server and open a browser pointing to its URL:
Copy file name to clipboardExpand all lines: packages/ripple/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,10 @@ A [Material Components](https://material.io/components/) icon implementation usi
5
5
6
6
* The easiest way to try out mwc-ripple is to use one of these online tools:
7
7
8
-
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
8
+
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
9
9
10
-
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
11
-
[CodePen](https://codepen.io/azakus/pen/deZLja).
10
+
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
11
+
[CodePen](https://codepen.io/azakus/pen/deZLja).
12
12
13
13
* You can also copy [this HTML file](https://gist.githubusercontent.com/azakus/f01e9fc2ed04e781ad5a52ded7b296e7/raw/266f2f4f91cbfe89b2acc6ec63957b1a3cfe9b39/index.html) into a local file and run it in any browser that supports [JavaScript Modules]((https://caniuse.com/#search=modules)).
14
14
@@ -42,7 +42,7 @@ A [Material Components](https://material.io/components/) icon implementation usi
42
42
43
43
1. Install the Polymer CLI:
44
44
45
-
```npm i -g polymer-cli@next```
45
+
```npm i -g polymer-cli```
46
46
47
47
1. Run the development server and open a browser pointing to its URL:
Copy file name to clipboardExpand all lines: packages/switch/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,10 @@ A [Material Components](https://material.io/components/) icon implementation usi
5
5
6
6
* The easiest way to try out mwc-switch is to use one of these online tools:
7
7
8
-
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
8
+
* Runs in all [supported](#supported-browsers) browsers: [StackBlitz](https://stackblitz.com/edit/mwc-icon-example?file=index.js), [Glitch](https://glitch.com/edit/#!/mwc-icon-example?path=index.html)
9
9
10
-
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
11
-
[CodePen](https://codepen.io/azakus/pen/deZLja).
10
+
* Runs in browsers with [JavaScript Modules](https://caniuse.com/#search=modules): [JSBin](http://jsbin.com/qibisux/edit?html,output),
11
+
[CodePen](https://codepen.io/azakus/pen/deZLja).
12
12
13
13
* You can also copy [this HTML file](https://gist.githubusercontent.com/azakus/f01e9fc2ed04e781ad5a52ded7b296e7/raw/266f2f4f91cbfe89b2acc6ec63957b1a3cfe9b39/index.html) into a local file and run it in any browser that supports [JavaScript Modules]((https://caniuse.com/#search=modules)).
14
14
@@ -42,7 +42,7 @@ A [Material Components](https://material.io/components/) icon implementation usi
42
42
43
43
1. Install the Polymer CLI:
44
44
45
-
```npm i -g polymer-cli@next```
45
+
```npm i -g polymer-cli```
46
46
47
47
1. Run the development server and open a browser pointing to its URL:
0 commit comments