Vivid API

Range Slider

Allows users to select a range. It includes two thumb controls that can be dragged to set the start and end values.

Usage

import { registerRangeSlider } from '@vonage/vivid-api';
registerRangeSlider('your-prefix');

Min

Use the min attribute to set the lowest value allowed for the Range Slider. The default value of min is 0.

Max

Use the max attribute to set the highest value allowed for the Range Slider. The default value max of is 10.

Step

Use the step attribute sets the granularity with which values can be incremented/decremented. The default value step of is 1.

Start

Use the start attribute to set the lower position of the range indicator. The default value of start is min.

End

Use the end attribute to set the upper position of the range indicator.
The default value of end is max.

Value Text Formatter

Use the valueTextFormatter to generates a string for the Range Slider’s “aria-valuetext” attribute based on the current value.
Use this to configure the pin string.

API Reference

Properties

PropertyTypeDefaultDescription
ariaEndLabelstringAria label for the end thumb
ariaStartLabelstringAria label for the start thumb
connotation'accent' | 'cta'The connotation of the component
disabledbooleanSets the element's disabled state. A disabled element will not be included during form submission.
currentEnd
(end)
stringThe current end value of the element. This property serves as a mechanism to set the `end` property through both property assignment and the .setAttribute() method. This is useful for setting the field's value in UI libraries that bind data through the .setAttribute() API and don't support IDL attribute binding.
endAsNumber
(endAsNumber)
numberThe end property, typed as a number.
initialEndstringThe initial end value. This value sets the `end` property only when the `end` property has not been explicitly set.
initialStartstringThe initial start value. This value sets the `start` property only when the `start` property has not been explicitly set.
initialValuestringThe default value of the element. This value sets the `value` property only when the `value` property has not been explicitly set.
labelstringThe label for the form element.
markersbooleanDisplay markers on/off
maxnumberThe maximum value of the range.
minnumberThe minimum value of the range.
namestringThe name of the element. This element's value will be surfaced during form submission under the provided name.
orientation'horizontal' | 'vertical'The orientation of the slider.
pinbooleanShow current values on the thumbs.
requiredbooleanRequire the field to be completed prior to form submission.
currentStart
(start)
stringThe current start value of the element. This property serves as a mechanism to set the `start` property through both property assignment and the .setAttribute() method. This is useful for setting the field's value in UI libraries that bind data through the .setAttribute() API and don't support IDL attribute binding.
startAsNumber
(startAsNumber)
numberThe start property, typed as a number.
stepnumberValue to increment or decrement via arrow keys, mouse click or drag.
valuestringThe current value of the element.
valueTextFormatter((value: string) => string)Custom function that generates a string for the component's "aria-valuetext" attribute based on the current value.
PropertyTypeDefaultDescription
aria-end-labelstringAria label for the end thumb
aria-start-labelstringAria label for the start thumb
connotation'accent' | 'cta'The connotation of the component
disabledbooleanSets the element's disabled state. A disabled element will not be included during form submission.
current-endstringThe current end value of the element. This property serves as a mechanism to set the `end` property through both property assignment and the .setAttribute() method. This is useful for setting the field's value in UI libraries that bind data through the .setAttribute() API and don't support IDL attribute binding.
endAsNumber
(property only)
numberThe end property, typed as a number.
endstringThe initial end value. This value sets the `end` property only when the `end` property has not been explicitly set.
startstringThe initial start value. This value sets the `start` property only when the `start` property has not been explicitly set.
valuestringThe default value of the element. This value sets the `value` property only when the `value` property has not been explicitly set.
labelstringThe label for the form element.
markersbooleanDisplay markers on/off
maxnumberThe maximum value of the range.
minnumberThe minimum value of the range.
namestringThe name of the element. This element's value will be surfaced during form submission under the provided name.
orientation'horizontal' | 'vertical'The orientation of the slider.
pinbooleanShow current values on the thumbs.
requiredbooleanRequire the field to be completed prior to form submission.
current-startstringThe current start value of the element. This property serves as a mechanism to set the `start` property through both property assignment and the .setAttribute() method. This is useful for setting the field's value in UI libraries that bind data through the .setAttribute() API and don't support IDL attribute binding.
startAsNumber
(property only)
numberThe start property, typed as a number.
stepnumberValue to increment or decrement via arrow keys, mouse click or drag.
current-valuestringThe current value of the element.
valueTextFormatter
(property only)
((value: string) => string)Custom function that generates a string for the component's "aria-valuetext" attribute based on the current value.

Events

NameTypeDescription
changeCustomEvent<undefined>Event emitted when either the start or end value changes.
inputCustomEvent<undefined>Event emitted when either the start or end value changes.
input:endCustomEvent<undefined>Event emitted when the end value changes
input:startCustomEvent<undefined>Event emitted when the start value changes
NameTypeDescription
changeCustomEvent<undefined>Event emitted when either the start or end value changes.
inputCustomEvent<undefined>Event emitted when either the start or end value changes.
input:endCustomEvent<undefined>Event emitted when the end value changes
input:startCustomEvent<undefined>Event emitted when the start value changes

Methods

NameParamsReturnsDescription
checkValiditybooleanReturn the current validity of the element.
formResetCallbackvoid
reportValiditybooleanReturn the current validity of the element. If false, fires an invalid event at the element.