A Material Design icon button

Published on NPM Build status Published on webcomponents.org

<paper-icon-button>

paper-icon-button is a button with an image placed at the center. When the user touches the button, a ripple effect emanates from the center of the button.

paper-icon-button does not include a default icon set. To use icons from the default set, include @polymer/iron-icons/iron-icons.js, and use the icon attribute to specify which icon from the icon set to use.

See: Documentation, Demo.

Usage

Installation

npm install --save @polymer/paper-icon-button

In an html file

<html>
  <head>
    <script type="module">
      import '@polymer/paper-icon-button/paper-icon-button.js';
      import '@polymer/iron-icons/iron-icons.js';
    </script>
  </head>
  <body>
    <paper-icon-button icon="favorite"></paper-icon-button>
  </body>
</html>

In a Polymer 3 element

import {PolymerElement, html} from '@polymer/polymer';
import '@polymer/paper-icon-button/paper-icon-button.js';
import '@polymer/iron-icons/iron-icons.js';

class SampleElement extends PolymerElement {
  static get template() {
    return html`
      <paper-icon-button icon="favorite"></paper-icon-button>
    `;
  }
}
customElements.define('sample-element', SampleElement);

Contributing

If you want to send a PR to this element, here are the instructions for running the tests and demo locally:

Installation

git clone https://github.com/PolymerElements/paper-icon-button
cd paper-icon-button
npm install
npm install -g polymer-cli

Running the demo locally

polymer serve --npm
open http://127.0.0.1:<port>/demo/

Running the tests

polymer test --npm

Install

Link to this version
ImportedReleased 16 January 2019Other
Framework Support
Polymer 2.0+
Also supported:
Polymer 1 (3.0.2)Polymer 3 (3.0.2)
Browser Compatibility
Install with
bower install --save PolymerElements/paper-icon-button"#2.2.1"
Run the above Bower command in your project folder. If you have any issues installing, please contact the author.
Release notes - Version 2.2.1

Dependencies

  • polymer#Polymer/polymer#1.9 - 2
  • iron-icon#PolymerElements/iron-icon#1 - 2
  • paper-behaviors#PolymerElements/paper-behaviors#1 - 2
  • paper-styles#PolymerElements/paper-styles#1 - 2