paper-icon-button
A Material Design icon button
<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
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
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
- Released
- 2019-01-16
- Maturity
- IMPORTED
- License
- Other
Compatibility
- Framework
- Polymer 2.0+
- Polymer 3.0+ in 0.0.1
- Polymer 1.0+ in 0.8.0
- Browser
- Browser Independent
paper-icon-button - Vaadin Add-on Directory
A Material Design icon button[![Published on NPM](https://img.shields.io/npm/v/@polymer/paper-icon-button.svg)](https://www.npmjs.com/package/@polymer/paper-icon-button)
[![Build status](https://travis-ci.org/PolymerElements/paper-icon-button.svg?branch=master)](https://travis-ci.org/PolymerElements/paper-icon-button)
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/paper-icon-button)
## <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](https://www.webcomponents.org/element/@polymer/paper-icon-button),
[Demo](https://www.webcomponents.org/element/@polymer/paper-icon-button/demo/demo/index.html).
## Usage
### Installation
```
npm install --save @polymer/paper-icon-button
```
### In an html file
```html
```
### In a Polymer 3 element
```js
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`
`;
}
}
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
```sh
git clone https://github.com/PolymerElements/paper-icon-button
cd paper-icon-button
npm install
npm install -g polymer-cli
```
### Running the demo locally
```sh
polymer serve --npm
open http://127.0.0.1:/demo/
```
### Running the tests
```sh
polymer test --npm
```