| <!doctype html> |
| <!-- |
| @license |
| Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt |
| The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt |
| Code distributed by Google as part of the polymer project is also |
| subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt |
| --> |
| <html> |
| <head> |
| <title>paper-radio-group demo</title> |
| |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> |
| <meta name="mobile-web-app-capable" content="yes"> |
| <meta name="apple-mobile-web-app-capable" content="yes"> |
| |
| <script src="../../webcomponentsjs/webcomponents-lite.js"></script> |
| <link rel="import" href="../../iron-demo-helpers/demo-snippet.html"> |
| <link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html"> |
| <link rel="import" href="../../paper-radio-button/paper-radio-button.html"> |
| <link rel="import" href="../paper-radio-group.html"> |
| |
| <style is="custom-style" include="demo-pages-shared-styles"> |
| .vertical-section-container { |
| max-width: 500px; |
| } |
| |
| label { |
| align-self: center; |
| } |
| </style> |
| </head> |
| |
| <body unresolved> |
| <div class="vertical-section-container centered"> |
| <h3>A paper-radio-group allows only one item to be selected</h3> |
| <demo-snippet class="centered-demo"> |
| <template> |
| <label id="label1">Dinosaurs:</label> |
| <paper-radio-group aria-labelledby="label1"> |
| <paper-radio-button name="a">allosaurus</paper-radio-button> |
| <paper-radio-button name="b">brontosaurus</paper-radio-button> |
| <paper-radio-button name="d" disabled>diplodocus</paper-radio-button> |
| </paper-radio-group> |
| </template> |
| </demo-snippet> |
| |
| <h3>It can have an initial selection</h3> |
| <demo-snippet class="centered-demo"> |
| <template> |
| <label id="label2">Dinosaurs:</label> |
| <paper-radio-group selected="b" aria-labelledby="label2"> |
| <paper-radio-button name="a">allosaurus</paper-radio-button> |
| <paper-radio-button name="b">brontosaurus</paper-radio-button> |
| <paper-radio-button name="d" disabled>diplodocus</paper-radio-button> |
| </paper-radio-group> |
| </template> |
| </demo-snippet> |
| |
| <h3>It can optionally allow items to be deselected</h3> |
| <demo-snippet class="centered-demo"> |
| <template> |
| <label id="label3">Dinosaurs:</label> |
| <paper-radio-group selected="b" allow-empty-selection aria-labelledby="label3"> |
| <paper-radio-button name="a">allosaurus</paper-radio-button> |
| <paper-radio-button name="b">brontosaurus</paper-radio-button> |
| <paper-radio-button name="d" disabled>diplodocus</paper-radio-button> |
| </paper-radio-group> |
| </template> |
| </demo-snippet> |
| |
| </div> |
| </body> |
| </html> |