Polymer - Paper Icon Button



Paper-icon-button is an action button, which represents a particular action such as settings. It has a ripple effect, when the user touches the button. You can use these buttons as a link or you can give some styling to the buttons as shown in the following example. To get paper-icon-button and iron-icons in your directory, in working condition you should run the following command in the command prompt.

bower install --save PolymerElements/paper-icon-button

Example

Your index.html file should look like the following.

<!doctype html>
<html>
   <head>
      <link rel = 'import' href = 'my-app.html'>
   </head>
   
   <body>    
      <my-app></my-app>
   </body>
</html>

Your my-app.html file should look like the following.

<link rel = 'import' href = 'bower_components/polymer/polymer.html'>
<link rel = "import" href = "bower_components/iron-icons/iron-icons.html">
<link rel = "import" href = "bower_components/paper-icon-button/paper-icon-button.html">

<dom-module id = 'my-app'>
   <template>
      <h3>Paper-Icon-Button Example </h3>
      <paper-icon-button icon = "settings" ></paper-icon-button>settings
      <br>
      <paper-icon-button icon = "warning" style = "color: red;" ></paper-icon-button>warning
      <br>
      <paper-icon-button icon = "content-cut" ></paper-icon-button>content-cut
      <br>
      <paper-icon-button icon = "dashboard" ></paper-icon-button>dashboard
      <br>
      <paper-icon-button icon = "flight-takeoff" ></paper-icon-button>flight-takeoff
      <br>
   </template>

   <script>
      Polymer ({
         is: 'my-app',
         ready: function() {
            this.async(function() {         
            });
         }
      });
   </script>
</dom-module>

Output

Refresh the Polymer server and following will be the output.

paper-icon-button
polymer_elements.htm
Advertisements