ToolJet/docs/versioned_docs/version-3.16.0-LTS/widgets/range-slider.md

102 lines
11 KiB
Markdown
Raw Normal View History

2025-08-04 06:49:49 +00:00
---
id: range-slider
title: Range Slider
---
The **Range Slider** component allows users to select a value or a range of values by sliding a handle along a track. Its perfect for adjusting numeric inputs like price, rating, or volume in an intuitive and interactive way.
## Properties
### Slider
2025-08-08 05:39:41 +00:00
| <div style={{ width:"100px"}}> Property </div> | <div style={{ width:"150px"}}> Description </div> | <div style={{ width:"250px"}}> Expected Value </div> |
| :--------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------ |
| Label | Text to display as the label for the field. | String |
| Min value | Set the minimum value for the slider. | This field accepts any numerical value. |
| Max value | Set the maximum value for the slider. | This field accepts any numerical value. |
| Default value | Set the default value when the component loads. This can be used to pre-fill the value based on your data and requirements. | This field accepts any numerical value. |
| Step size | Choose the step size for the slider. | This field accepts any numerical value. |
| Set marks | Set marking on the slider. | Accepts an array of objects with `label` and `value` as properties. |
2025-08-04 06:49:49 +00:00
### Range slider
2025-08-08 05:39:41 +00:00
| <div style={{ width:"100px"}}> Property </div> | <div style={{ width:"150px"}}> Description </div> | <div style={{ width:"250px"}}> Expected Value </div> |
| :--------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------ |
| Label | Text to display as the label for the field. | String |
| Min value | Set the minimum value for the slider. | This field accepts any numerical value. |
| Max value | Set the maximum value for the slider. | This field accepts any numerical value. |
| Default start value | Set the default start value when the component loads. This can be used to pre-fill the value based on your data and requirements. | This field accepts any numerical value. |
| Default end value | Set the end default value when the component loads. This can be used to pre-fill the value based on your data and requirements. | This field accepts any numerical value. |
| Step size | Choose the step size for the slider. | This field accepts any numerical value. |
| Set marks | Set marking on the slider. | Accepts an array of objects with `label` and `value` as properties. |
2025-08-04 06:49:49 +00:00
## Events
2025-08-08 05:39:41 +00:00
| Event | Description |
| :-------- | :-------------------------------------- |
| On change | Triggers whenever the value is changed. |
2025-08-04 06:49:49 +00:00
:::info
2025-08-08 05:39:41 +00:00
Check [Action Reference](/docs/actions/run-query) docs to get detailed information about all the **Actions**.
2025-08-04 06:49:49 +00:00
:::
## Component Specific Actions (CSA)
The following actions of the component can be controlled using the component-specific actions (CSA), you can trigger it using an event or use a RunJS query.
2025-08-08 05:39:41 +00:00
| <div style={{ width:"130px"}}> Action </div> | <div style={{ width:"135px"}}> Description </div> | <div style={{width: "200px"}}> How To Access </div> |
| :------------------------------------------- | :------------------------------------------------ | :-------------------------------------------------- |
| setValue( ) | Sets the value of the component. | `components.rangeslider1.setValue()` |
| setRangeValue( ) | Sets the range of the component. | `components.rangeslider1.setRangeValue()` |
| setVisibility( ) | Sets the visibility of the component. | `components.rangeslider1.setVisibility(false)` |
| setLoading( ) | Sets the loading state of the component. | `components.rangeslider1.setLoading(true)` |
| setDisable( ) | Disables the component. | `components.rangeslider1.setDisable(true)` |
| reset( ) | Resets the component to default state. | `components.rangeslider1.reset()` |
2025-08-04 06:49:49 +00:00
## Exposed Variables
2025-08-08 05:39:41 +00:00
| Variables | Description | How To Access |
| :-------- | :------------------------------------------------------------------ | :---------------------------------- |
| value | Holds the value of the slider, or an array when using range slider. | `{{components.rangeslider1.value}}` |
| label | Holds the value of the component's label. | `{{components.rangeslider1.label}}` |
2025-08-04 06:49:49 +00:00
## Additional Actions
2025-08-08 05:39:41 +00:00
| <div style={{ width:"100px"}}> Action </div> | <div style={{ width:"150px"}}> Description </div> | <div style={{ width:"250px"}}> Configuration Options </div> |
| :------------------------------------------- | :------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------- |
| Loading state | Enables a loading spinner, often used with `isLoading` to indicate progress. Toggle or set dynamically. | Enable/disable the toggle button or dynamically configure the value by clicking on **fx** and entering a logical expression. |
| Visibility | Controls component visibility. Toggle or set dynamically. | Enable/disable the toggle button or dynamically configure the value by clicking on **fx** and entering a logical expression. |
| Disable | Enables or disables the component. Toggle or set dynamically. | Enable/disable the toggle button or dynamically configure the value by clicking on **fx** and entering a logical expression. |
| Tooltip | Provides additional information on hover. Set a string value for display. | String |
2025-08-04 06:49:49 +00:00
## Devices
2025-08-08 05:39:41 +00:00
| <div style={{ width:"100px"}}> Property </div> | <div style={{ width:"150px"}}> Description </div> | <div style={{ width:"250px"}}> Expected Value </div> |
| :--------------------------------------------- | :------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------- |
| Show on desktop | Makes the component visible in desktop view. | You can set it with the toggle button or dynamically configure the value by clicking on **fx** and entering a logical expression. |
| Show on mobile | Makes the component visible in mobile view. | You can set it with the toggle button or dynamically configure the value by clicking on **fx** and entering a logical expression. |
2025-08-04 06:49:49 +00:00
## Styles
### Label
2025-08-08 05:39:41 +00:00
| <div style={{ width:"100px"}}> Property </div> | <div style={{ width:"150px"}}> Description </div> | <div style={{ width:"250px"}}> Configuration Options </div> |
| :--------------------------------------------- | :------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Text | Sets the color of the component's label. | Select the color or click on **fx** and input code that programmatically returns a Hex color code. |
2025-09-11 09:37:31 +00:00
| Alignment | Sets the position of the label and input field. | Click on the toggle options or click on **fx** to input code that programmatically returns an alignment value - **side** or **top**. |
| Width | Sets the width of the input field. | Enable **Auto width** to use the standard width automatically. Disable it to manually adjust the width using the slider or by entering a numeric value via **fx**. You can also choose whether the width is calculated relative to the **Container** or relative to the **Field**. |
2025-08-04 06:49:49 +00:00
### Slider
2025-08-08 05:39:41 +00:00
| Property | Description | Configuration Options |
| :------------ | :------------------------------- | :------------------------------------------ |
| Track | Sets the color for slider track. | Select a theme or choose from color picker. |
| Accent | Sets the accent color. | Select a theme or choose from color picker. |
| Handle | Sets the handle color. | Select a theme or choose from color picker. |
| Handle border | Sets the handle border color. | Select a theme or choose from color picker. |
| Market label | Sets the marker label color. | Select a theme or choose from color picker. |
2025-08-04 06:49:49 +00:00
:::info
Any property having **fx** button next to its field can be **programmatically configured**.
:::