Accessibility Compliance
SurveyJS libraries meet a variety of WCAG and Section 508 standards. Run AXE® Validation to assess this demo’s accessibility level.

Slider

Edit in →
Survey Creator

A Slider UI element presents a predefined range of values along a scale with a draggable thumb that users can move to select a number. It offers a user-friendly alternative to text boxes by visually representing the available input range. This example demonstrates the Slider question included out of the box in the SurveyJS Form Library.

Create a Slider Question

To add a Slider question to your survey or form, define an object with the type property set to "slider" and add it to the elements array. Within this object, specify the question's title and a unique name that identifies the question. Optionally, you can specify a description to place under the title.

Configure the Slider Scale

The slider scale defines the range of valid values and the interval between selectable points (snap points). The main scale settings include:

  • min: number
    The minimum value on the scale.

  • max: number
    The maximum value on the scale.

  • step: number
    The interval between snap points.

This example demonstrates both the default scale configuration—min: 0, max: 100, step: 1—and a customized one—min: -1000, max: 1000, step: 100.

A Slider also displays labels that indicate specific values along the scale. For details on how to configure these labels, refer to the following demo:

Configure Slider Scale Labels

Set a Default Slider Value

The default value sets the initial position of the slider thumb and is saved in the survey results if the user doesn't change the selection. By default, this value is undefined, and the thumb starts at 0. Use the defaultValue property to assign a static default, or the defaultValueExpression property to calculate it dynamically.

In this demo, the bottom Slider has a default value of 50, specified using the defaultValue property.

Your cookie settings

We use cookies on our site to make your browsing experience more convenient and personal. In some cases, they are essential to making the site work properly. By clicking "Accept All", you consent to the use of all cookies in accordance with our Terms of Use & Privacy Statement. However, you may visit "Cookie settings" to provide a controlled consent.

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.