ApplicationImpl cleanup, part 1:
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components-chromium / iron-selector / iron-selector-extracted.js
blobd4306554fb59e48556820bbfc2b3a28b431511f6
2 /**
3 `iron-selector` is an element which can be used to manage a list of elements
4 that can be selected. Tapping on the item will make the item selected. The `selected` indicates
5 which item is being selected. The default is to use the index of the item.
7 Example:
9 <iron-selector selected="0">
10 <div>Item 1</div>
11 <div>Item 2</div>
12 <div>Item 3</div>
13 </iron-selector>
15 If you want to use the attribute value of an element for `selected` instead of the index,
16 set `attrForSelected` to the name of the attribute. For example, if you want to select item by
17 `name`, set `attrForSelected` to `name`.
19 Example:
21 <iron-selector attr-for-selected="name" selected="foo">
22 <div name="foo">Foo</div>
23 <div name="bar">Bar</div>
24 <div name="zot">Zot</div>
25 </iron-selector>
27 `iron-selector` is not styled. Use the `iron-selected` CSS class to style the selected element.
29 Example:
31 <style>
32 .iron-selected {
33 background: #eee;
35 </style>
37 ...
39 <iron-selector selected="0">
40 <div>Item 1</div>
41 <div>Item 2</div>
42 <div>Item 3</div>
43 </iron-selector>
45 @demo demo/index.html
48 Polymer({
50 is: 'iron-selector',
52 behaviors: [
53 Polymer.IronMultiSelectableBehavior
56 });