If you're familiar with Polymer and just want to get started with the new release, you're in the right place! If you'd like an introduction to the Polymer project and web components:
- Take a quick tour of Polymer
- Learn how to build your first Polymer app
- Learn how to build your first element with the Polymer library
Polymer is distributed via the Bower package manager.
To create an application template and install Polymer automatically, you can use the Polymer CLI.
To start a project from scratch, you can install Polymer with Bower.
Use the Polymer CLI to create an application template and install Polymer
The Polymer CLI requires Node.js, npm, Git and Bower. For full installation instructions, see the Polymer CLI documentation.
-
Install the Polymer CLI.
npm install -g polymer-cli
-
Create a test folder for Polymer 2.0, and switch to it.
mkdir polymer-20-test cd polymer-20-test
-
Initialize your project.
polymer init
-
Select
polymer-2-application
. -
Serve your project.
polymer serve
Install Polymer from Bower
-
Install Bower.
npm install -g bower
-
Install the Polymer CLI
The Polymer CLI requires Node.js and npm as well as Bower. For full installation instructions, see the Polymer CLI documentation.
npm install -g polymer-cli
-
Install the latest Polymer 2.0 release from bower
bower install Polymer/polymer#^2.0.0
-
Create a test
index.html
file, and add the following in the<head>
tag:
<script src="/bower_components/webcomponentsjs/webcomponents-loader.js"></script>
to load the polyfills<link rel="import" href="/bower_components/polymer/polymer.html">
to import Polymer
-
Import and use whichever elements you’d like.
-
Serve your project.
polymer serve
For information on building your project for production, see the documentation on building Polymer applications for production.