Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
.github/ | H | 25-Apr-2025 | - | 34 | 14 | |
demo/ | H | 25-Apr-2025 | - | 162 | 132 | |
test/ | H | 25-Apr-2025 | - | 196 | 136 | |
.bower.json | H A D | 25-Apr-2025 | 1.5 KiB | 50 | 50 | |
.gitignore | H A D | 25-Apr-2025 | 17 | 2 | 1 | |
.travis.yml | H A D | 25-Apr-2025 | 784 | 25 | 24 | |
CONTRIBUTING.md | H A D | 25-Apr-2025 | 3.4 KiB | 78 | 39 | |
README.md | H A D | 25-Apr-2025 | 3.2 KiB | 96 | 46 | |
bower.json | H A D | 25-Apr-2025 | 1.1 KiB | 41 | 40 | |
index.html | H A D | 25-Apr-2025 | 763 | 24 | 10 | |
paper-icon-button-light.html | H A D | 25-Apr-2025 | 2.7 KiB | 99 | 67 | |
paper-icon-button.html | H A D | 25-Apr-2025 | 5.2 KiB | 177 | 92 |
README.md
1 2<!--- 3 4This README is automatically generated from the comments in these files: 5paper-icon-button-light.html paper-icon-button.html 6 7Edit those files, and our readme bot will duplicate them over here! 8Edit this file, and the bot will squash your changes :) 9 10The bot does some handling of markdown. Please file a bug if it does the wrong 11thing! https://github.com/PolymerLabs/tedium/issues 12 13--> 14 15[](https://travis-ci.org/PolymerElements/paper-icon-button) 16 17_[Demo and API docs](https://elements.polymer-project.org/elements/paper-icon-button)_ 18 19 20##<paper-icon-button> 21 22Material design: [Icon toggles](https://www.google.com/design/spec/components/buttons.html#buttons-toggle-buttons) 23 24`paper-icon-button` is a button with an image placed at the center. When the user touches 25the button, a ripple effect emanates from the center of the button. 26 27`paper-icon-button` includes a default icon set. Use `icon` to specify which icon 28from the icon set to use. 29 30<!--- 31```html 32<custom-element-demo> 33 <template> 34 <script src="../webcomponentsjs/webcomponents-lite.js"></script> 35 <link rel="import" href="paper-icon-button.html"> 36 <link rel="import" href="../iron-icons/iron-icons.html"> 37 <next-code-block></next-code-block> 38 </template> 39</custom-element-demo> 40``` 41--> 42```html 43<paper-icon-button icon="favorite"></paper-icon-button> 44<paper-icon-button icon="menu"></paper-icon-button> 45<paper-icon-button icon="star"></paper-icon-button> 46``` 47 48See [`iron-iconset`](https://github.com/PolymerElements/iron-iconset) for more information about 49how to use a custom icon set. 50 51Example: 52 53```html 54<link href="path/to/iron-icons/iron-icons.html" rel="import"> 55 56<paper-icon-button icon="favorite"></paper-icon-button> 57<paper-icon-button src="star.png"></paper-icon-button> 58``` 59 60To use `paper-icon-button` as a link, wrap it in an anchor tag. Since `paper-icon-button` 61will already receive focus, you may want to prevent the anchor tag from receiving focus 62as well by setting its tabindex to -1. 63 64```html 65<a href="https://www.polymer-project.org" tabindex="-1"> 66 <paper-icon-button icon="polymer"></paper-icon-button> 67</a> 68``` 69 70### Styling 71 72Style the button with CSS as you would a normal DOM element. If you are using the icons 73provided by `iron-icons`, they will inherit the foreground color of the button. 74 75```html 76/* make a red "favorite" button */ 77<paper-icon-button icon="favorite" style="color: red;"></paper-icon-button> 78``` 79 80By default, the ripple is the same color as the foreground at 25% opacity. You may 81customize the color using the `--paper-icon-button-ink-color` custom property. 82 83The following custom properties and mixins are available for styling: 84 85| Custom property | Description | Default | 86| --- | --- | --- | 87| `--paper-icon-button-disabled-text` | The color of the disabled button | `--disabled-text-color` | 88| `--paper-icon-button-ink-color` | Selected/focus ripple color | `--primary-text-color` | 89| `--paper-icon-button` | Mixin for a button | `{}` | 90| `--paper-icon-button-disabled` | Mixin for a disabled button | `{}` | 91| `--paper-icon-button-hover` | Mixin for button on hover | `{}` | 92 93 94 95<!-- No docs for <paper-icon-button-light> found. --> 96