Slider
Default
Copy Pug Copy HTML Open in playground Show code Hide code
<e-slider></e-slider><e-slider></e-slider>JavaScript Copy JavaScript
Variations
Range Copy Pug Copy HTML Open in playground Show code Hide code
<e-slider value="20,40" range></e-slider><e-slider value="20,40" range></e-slider>JavaScript Copy JavaScript
Range with steps Copy Pug Copy HTML Open in playground Show code Hide code
<e-slider value="-50,50" min="-200" max="200" range step="50" show-steps></e-slider><e-slider value="-50,50" min="-200" max="200" range step="50" show-steps></e-slider>JavaScript Copy JavaScript
With value Copy Pug Copy HTML Open in playground Show code Hide code
<e-slider value="20"></e-slider><e-slider value="20"></e-slider>JavaScript Copy JavaScript
With min and max Copy Pug Copy HTML Open in playground Show code Hide code
<e-slider value="-40" min="-80" max="40"></e-slider><e-slider value="-40" min="-80" max="40"></e-slider>JavaScript Copy JavaScript
With min and max Copy Pug Copy HTML Open in playground Show code Hide code
<e-slider value="250" min="200" max="300"></e-slider><e-slider value="250" min="200" max="300"></e-slider>JavaScript Copy JavaScript
With step Copy Pug Copy HTML Open in playground Show code Hide code
<e-slider min="200" max="300" step="10"></e-slider><e-slider min="200" max="300" step="10"></e-slider>JavaScript Copy JavaScript
With show-steps Copy Pug Copy HTML Open in playground Show code Hide code
<e-slider min="0" max="200" step="10" show-steps></e-slider><e-slider min="0" max="200" step="10" show-steps></e-slider>JavaScript Copy JavaScript
With labels Copy Pug Copy HTML Open in playground Show code Hide code
<e-slider min-label="Minimum" max-label="Maximum"></e-slider><e-slider min-label="Minimum" max-label="Maximum"></e-slider>JavaScript Copy JavaScript
Without bubble Copy Pug Copy HTML Open in playground Show code Hide code
<e-slider no-bubble></e-slider><e-slider no-bubble></e-slider>JavaScript Copy JavaScript
Disabled Copy Pug Copy HTML Open in playground Show code Hide code
<e-slider disabled="true"></e-slider><e-slider disabled="true"></e-slider>JavaScript Copy JavaScript
Values Copy Pug Copy HTML Open in playground Show code Hide code
<e-slider step="1" max="3" value="0" show-steps no-bubble></e-slider>
<div class="e-slider e-slider-values">
<div class="e-slider__value e-slider__value-min">
No Access
</div>
<div class="e-slider__value">
Basic Access
</div>
<div class="e-slider__value">
Editor Access
</div>
<div class="e-slider__value e-slider__value-max">
Manager Access
</div>
</div><e-slider step="1" max="3" value="0" show-steps no-bubble></e-slider>
<div class="e-slider e-slider-values">
<div class="e-slider__value e-slider__value-min">
No Access
</div>
<div class="e-slider__value">
Basic Access
</div>
<div class="e-slider__value">
Editor Access
</div>
<div class="e-slider__value e-slider__value-max">
Manager Access
</div>
</div>JavaScript Copy JavaScript
API Reference
Properties
| Name | Description | Type | Required | Default value |
|---|---|---|---|---|
| value | Initial value of the slider | string | 50 | |
| range | Range slider, values should be separated with comma, eg: '20,80' | boolean | false | |
| min | Minimum value for the slider, should be smaller than maximum. If maximum has not given, this should be smaller than 100 | int | 0 | |
| max | Maximum value for the slider, should be larger than minimum. If minimum has not given, this should be larger than 0 | int | 100 | |
| step | Number of intervals for the slider | int | 1 | |
| show-steps | Display legal numbers on the slider | int | false | |
| min-label | Text to display in the minimum position | string | ||
| max-label | Text to display in the maximum position | string | ||
| no-bubble | Disable value tooltip on the bubble | boolean | false | |
| disabled | Disabled state for the slider | boolean | false | |
| priority | The color of slider. Can be any value that has a corresponding text-color utility class. | string | secondary |
Events
| Event | Description | Returns |
|---|---|---|
update | Fires on value update | {
detail: {
value: [as string],
inprogress: true/false,
lowValue: [as int, only on range],
highValue: [as int, only on range]
}
} |