Slider

Extended from PrimeVue Slider

Simple example

This slider allows the user to select a value from 1 to 20 with an allowed step increment of 1.

How many rooms are in your house?

120

Selected value: 1

Label and tooltip formatting

This slider uses formatting functions to add a dollar sign to the minimum/maximum labels and the tooltip showing the current value.

How much is your average monthly bill?

$50$1200

Selected value: $200

Manual data binding and aria label

Though two-day data binding via v-model is recommended, it's also possible to use the startingValue prop and listen to the @change event to hook up the slider to a variable.

This example also shows using ariaLabel instead of ariaLabelledby to describe the purpose of the slider to screen reader users.

What is the minimum credit score necessary to qualify?

0800

Selected value: 650

Disabled

This slider is disabled. Use this state sparingly and only as a temporary visual indication (for example, during a form submission), as there is a known issue with PrimeVue's slider where it can still receive focus via keyboard when disabled and the value of the slider can be modified via the keyboard.

What percentage of your home do you want to heat or cool?

0%100%

Selected value: 50%

EsSlider props

Name
ariaLabel
Type
String
Default
null
Description
Accessible label for slider handle.
Name
ariaLabelledby
Type
String
Default
null
Description
Id of an element containing an accessible description for the slider.
Name
disabled
Type
Boolean
Default
false
Description
Indicates whether or not the slider should be disabled.
Name
labelFormatter
Type
Function
Default
(val) => val
Description
Function that modifies min and max labels.
Name
max
Type
Number
Default
100
Description
Required. Maximum value of slider.
Name
min
Type
Number
Default
1
Description
Required. Minimum value of slider.
Name
startingValue
Type
Number
Default
1
Description
Required. Initial value of slider.
Name
step
Type
Number
Default
1
Description
Step factor to increment/decrement the value.
Name
tooltipFormatter
Type
Function
Default
(val) => val
Description
Function that modifies tooltip label.

Migration from ESDS 2.0/Nuxt 2