2 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 Code distributed by Google as part of the polymer project is also
7 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 <link rel=
"import" href=
"../polymer/polymer.html">
11 <link rel=
"import" href=
"../paper-ripple/paper-ripple.html">
12 <link rel=
"import" href=
"../paper-styles/default-theme.html">
13 <link rel=
"import" href=
"../paper-behaviors/paper-inky-focus-behavior.html">
16 `paper-radio-button` is a button that can be either checked or unchecked.
17 User can tap the radio button to check or uncheck it.
19 Use a `<paper-radio-group>` to group a set of radio buttons. When radio buttons
20 are inside a radio group, exactly one radio button in the group can be checked
25 <paper-radio-button></paper-radio-button>
26 <paper-radio-button>Item label</paper-radio-button>
30 The following custom properties and mixins are available for styling:
32 Custom property | Description | Default
33 ----------------|-------------|----------
34 `--paper-radio-button-unchecked-background-color` | Radio button background color when the input is not checked | `transparent`
35 `--paper-radio-button-unchecked-color` | Radio button color when the input is not checked | `--primary-text-color`
36 `--paper-radio-button-unchecked-ink-color` | Selected/focus ripple color when the input is not checked | `--primary-text-color`
37 `--paper-radio-button-checked-color` | Radio button color when the input is checked | `--default-primary-color`
38 `--paper-radio-button-checked-ink-color` | Selected/focus ripple color when the input is checked | `--default-primary-color`
39 `--paper-radio-button-label-color` | Label color | `--primary-text-color`
42 @element paper-radio-button
47 <dom-module id=
"paper-radio-button">
49 <link rel=
"import" type=
"css" href=
"paper-radio-button.css">
53 <div id=
"radioContainer">
54 <div id=
"offRadio"></div>
55 <div id=
"onRadio"></div>
56 <paper-ripple id=
"ink" class=
"circle" center checked$=
"[[checked]]"></paper-ripple>
59 <div id=
"radioLabel" aria-hidden=
"true"><content></content></div>
65 is
: 'paper-radio-button',
68 Polymer
.PaperInkyFocusBehavior
73 'aria-checked': false,
79 * Fired when the checked state changes due to user interaction.
85 * Fired when the checked state changes.
91 * Gets or sets the state, `true` is checked and `false` is unchecked.
96 reflectToAttribute
: true,
98 observer
: '_checkedChanged'
102 * If true, the button toggles the active state with each tap or press
108 reflectToAttribute
: true
113 if (Polymer
.dom(this).textContent
== '') {
114 this.$.radioLabel
.hidden
= true;
116 this.setAttribute('aria-label', Polymer
.dom(this).textContent
);
118 this._isReady
= true;
121 _buttonStateChanged: function() {
126 this.checked
= this.active
;
130 _checkedChanged: function() {
131 this.setAttribute('aria-checked', this.checked
? 'true' : 'false');
132 this.active
= this.checked
;
133 this.fire('iron-change');