Contents
- Step
- Min and Max
Having trouble getting help?
Contact Support
Contact Support
Ticks in Vue Range Slider component
21 Feb 20259 minutes to read
The ticks
in Slider help you easily identify the current value/values of the Slider. It contains smallStep
and largeStep
. Only the values of major ticks will be displayed on the Slider. In order to enable/disable the small ticks, use the showSmallTicks
property.
<template>
<div id="app">
<ejs-slider id='ticks' :value='value' :tooltip="tooltip" :ticks="ticks"></ejs-slider>
</div>
</template>
<script setup>
import { SliderComponent as EjsSlider } from "@syncfusion/ej2-vue-inputs";
const tooltip = { placement: 'Before', isVisible: true, showOn: 'Always' };
const value = 30;
// Slider ticks customization
const ticks = { placement: 'After', largeStep: 20, smallStep: 10, showSmallTicks: true };
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-inputs/styles/material.css";
#app {
height: 40px;
left: 30%;
position: absolute;
top: 40%;
width: 50%;
}
</style>
<template>
<div id="app">
<ejs-slider id='ticks' :value='value' :tooltip="tooltip" :ticks="ticks"></ejs-slider>
</div>
</template>
<script>
import { SliderComponent } from "@syncfusion/ej2-vue-inputs";
export default {
name: "App",
components: {
"ejs-slider":SliderComponent
},
data() {
return {
tooltip: { placement: 'Before', isVisible: true, showOn: 'Always' },
value: 30,
// Slider ticks customization
ticks: { placement: 'After', largeStep: 20, smallStep: 10, showSmallTicks: true }
};
}
}
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-inputs/styles/material.css";
#app {
height: 40px;
left: 30%;
position: absolute;
top: 40%;
width: 50%;
}
</style>
Step
When the Slider is moved, it increases/decreases the value based on the step value. By default, the value increases/decreases by 1. Use the step
property to change the increment step value.
<template>
<div id="app">
<ejs-slider id='steps' :value='value' :tooltip="tooltip" :ticks="ticks" :step="step"></ejs-slider>
</div>
</template>
<script setup>
import { SliderComponent as EjsSlider } from "@syncfusion/ej2-vue-inputs";
const ticks = { placement: 'After', largeStep: 20, smallStep: 10, showSmallTicks: true };
const tooltip = { placement: 'Before', isVisible: true, showOn: 'Always' };
const value = 30;
// Enables step
const step = 10;
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-inputs/styles/material.css";
#app {
height: 40px;
left: 30%;
position: absolute;
top: 40%;
width: 50%;
}
</style>
<template>
<div id="app">
<ejs-slider id='steps' :value='value' :tooltip="tooltip" :ticks="ticks" :step="step"></ejs-slider>
</div>
</template>
<script>
import { SliderComponent } from "@syncfusion/ej2-vue-inputs";
export default {
name: "App",
components: {
"ejs-slider": SliderComponent
},
data() {
return {
ticks: { placement: 'After', largeStep: 20, smallStep: 10, showSmallTicks: true },
tooltip: { placement: 'Before', isVisible: true, showOn: 'Always' },
value: 30,
// Enables step
step: 10
};
}
}
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-inputs/styles/material.css";
#app {
height: 40px;
left: 30%;
position: absolute;
top: 40%;
width: 50%;
}
</style>
Min and Max
Enable the minimum/starting and maximum/ending values of the Slider, by using the min
and max
property. By default, the minimum value is 1 and maximum value is 100. In the following example, the Slider is rendered with a minimum value of 100 and a maximum value of 1000.
<template>
<div id="app">
<ejs-slider id='minmax' :value='value' :tooltip="tooltip" :ticks="ticks" :min="min" :max="max"></ejs-slider>
</div>
</template>
<script setup>
import { SliderComponent as EjsSlider } from "@syncfusion/ej2-vue-inputs";
const ticks = { placement: 'After', largeStep: 200, smallStep: 100, showSmallTicks: true };
const tooltip = { placement: 'Before', isVisible: true, showOn: 'Always' };
// Minimum value
const min = 100;
// Maximum value
const max = 1100;
// Slider current value
const value = 400;
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-inputs/styles/material.css";
#app {
height: 40px;
left: 30%;
position: absolute;
top: 40%;
width: 50%;
}
</style>
<template>
<div id="app">
<ejs-slider id='minmax' :value='value' :tooltip="tooltip" :ticks="ticks" :min="min" :max="max"></ejs-slider>
</div>
</template>
<script>
import { SliderComponent } from "@syncfusion/ej2-vue-inputs";
export default {
name: "App",
components: {
"ejs-slider": SliderComponent
},
data() {
return {
ticks: { placement: 'After', largeStep: 200, smallStep: 100, showSmallTicks: true },
tooltip: { placement: 'Before', isVisible: true, showOn: 'Always' },
// Minimum value
min: 100,
// Maximum value
max: 1100,
// Slider current value
value: 400
};
}
}
</script>
<style>
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-buttons/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-popups/styles/material.css";
@import "../node_modules/@syncfusion/ej2-vue-inputs/styles/material.css";
#app {
height: 40px;
left: 30%;
position: absolute;
top: 40%;
width: 50%;
}
</style>