2 Copyright (c) 2014 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
9 `paper-slider` allows user to select a value from a range of values by
10 moving the slider thumb. The interactive nature of the slider makes it a
11 great choice for settings that reflect intensity levels, such as volume,
12 brightness, or color saturation.
16 <paper-slider></paper-slider>
18 Use `min` and `max` to specify the slider range. Default is 0 to 100.
22 <paper-slider min="10" max="200" value="110"></paper-slider>
26 To change the slider progress bar color:
28 paper-slider::shadow #sliderBar::shadow #activeProgress {
29 background-color: #0f9d58;
32 To change the slider knob color:
34 paper-slider::shadow #sliderKnobInner {
35 background-color: #0f9d58;
38 To change the slider pin color:
40 paper-slider::shadow #sliderKnobInner::before {
41 background-color: #0f9d58;
44 To change the slider pin's font color:
46 paper-slider::shadow #sliderKnob > #sliderKnobInner::after {
50 To change the slider secondary progress bar color:
52 paper-slider::shadow #sliderBar::shadow #secondaryProgress {
53 background-color: #0f9d58;
60 --><html><head><link rel=
"import" href=
"../core-a11y-keys/core-a11y-keys.html">
61 <link rel=
"import" href=
"../paper-progress/paper-progress.html">
62 <link rel=
"import" href=
"../paper-input/paper-input.html">
64 </head><body><polymer-element name=
"paper-slider" extends=
"core-range" attributes=
"snaps pin disabled secondaryProgress editable immediateValue" role=
"slider" tabindex=
"0" aria-valuemin=
"0" aria-valuemax=
"100" assetpath=
"">
67 <link rel=
"stylesheet" href=
"paper-slider.css">
69 <template if=
"{{!disabled}}">
70 <core-a11y-keys target=
"{{}}" keys=
"left down pagedown home" on-keys-pressed=
"{{decrementKey}}"></core-a11y-keys>
71 <core-a11y-keys target=
"{{}}" keys=
"right up pageup end" on-keys-pressed=
"{{incrementKey}}"></core-a11y-keys>
74 <div id=
"sliderContainer" class=
"{{ {disabled: disabled, pin: pin, snaps: snaps, ring: immediateValue <= min, expand: expand, dragging: dragging, transiting: transiting, editable: editable} | tokenList }}">
76 <div class=
"bar-container">
77 <paper-progress id=
"sliderBar" aria-hidden=
"true" min=
"{{min}}" max=
"{{max}}" value=
"{{immediateValue}}" secondaryprogress=
"{{secondaryProgress}}" on-down=
"{{bardown}}" on-up=
"{{resetKnob}}" on-trackstart=
"{{trackStart}}" on-trackx=
"{{trackx}}" on-trackend=
"{{trackEnd}}"></paper-progress>
80 <template if=
"{{snaps && !disabled}}">
81 <div class=
"slider-markers" horizontal=
"" layout=
"">
82 <template repeat=
"{{markers}}">
83 <div flex=
"" class=
"slider-marker"></div>
88 <div id=
"sliderKnob" on-down=
"{{knobdown}}" on-up=
"{{resetKnob}}" on-trackstart=
"{{trackStart}}" on-trackx=
"{{trackx}}" on-trackend=
"{{trackEnd}}" on-transitionend=
"{{knobTransitionEnd}}" center-justified=
"" center=
"" horizontal=
"" layout=
"">
90 <div id=
"sliderKnobInner" value=
"{{immediateValue}}"></div>
96 <template if=
"{{editable}}">
97 <paper-input id=
"input" class=
"slider-input" value=
"{{immediateValue}}" disabled?=
"{{disabled}}" on-change=
"{{inputChange}}"></paper-input>
103 <script src=
"paper-slider-extracted.js"></script></body></html>