Slider
Select a single value or specify a range by choosing values for both its ends.
Last updated
Select a single value or specify a range by choosing values for both its ends.
Last updated
The Slider component is a user-friendly way to select a value from a range. It consists of a track with a handle that can be moved along the track to choose a value. The Slider component is commonly used for tasks such as adjusting the volume of a media player or setting a number within a specific range.
Here are the main properties you can configure on the Slider element
A slider can contain multiple values and specify a range between two or more numbers.
The Type attribute will determine the orientation of the slider. The Slider type can be horizontal
or vertical
.
By default, the increment value of the slider is set to 1, but you can customize the increment value of the slider by adding an incrementing number to the step
property.
Min and Max values can be specified to customize the range of your slider.
By default, the slider's unit is set to decimal
. But the unit can be customized to Currency
, Percent
or Custom
.
Currency: Displays the value as a currency (e.g., $, €, £).
Decimals: Shows the value with decimal places.
Percent: Shows the value as a percentage.
Custom: Lets you create your labels with corresponding values. These custom labels will be shown on the slider next to the appropriate value. For example, you could create labels like "Low", "Medium", and "High" to represent different ranges on your slider.
Custom Label Styling
Styling options for custom labels are available in the styling panel, where you can adjust minWidth
, maxWidth
, and line clamp
. This allows you to control the visual presentation and ensure that labels, even long ones, are displayed correctly.
Displays a marker on the slider to highlight the current value.
Adds tick marks along the slider to show the different steps or values. This is useful when you've set specific steps for the slider.
This option prevents the slider's minimum and maximum values from being swapped. By default, if you set the minimum value to be greater than the maximum value, the slider will automatically swap them. Enabling "Disable Swap" prevents this behavior.
Interactions make your slider respond to user actions. You can choose what happens when someone interacts with the slider. For instance, when the slider's value changes, you might want to display a message or trigger another part of your flow.
Here's a list of the available interactions.
On Change: This is triggered when the slider's value is modified. For example, you could configure this to display a toast message with the new slider value or open a new screen flow to collect additional information based on the selected value.
The "Style" panel lets you change how your slider looks.
Here are the different parts you can customize:
Label: Change the text shown above the slider.
Unit: Add a unit label next to the slider value (e.g., "km", "years", "$").
Track: Change the appearance of the slider track (the line the slider moves along).
Pin: Customize the look of the pin that marks the current value (if you've enabled it in the advanced options).
Thumb: Change the appearance of the slider thumb (the draggable part of the slider)
Enhance the visual appearance of your Avonni Sliders by applying custom gradient backgrounds. Here's how to use gradients:
Gradient Settings: In the Style panel, locate the "Background" section. Here, you'll find new gradient settings.
Customize Your Gradient:
Gradient Type: Choose between "Linear" or "Radial" for different gradient effects.
Gradient Angle (Linear): Set the direction of your linear gradient.
Gradient Colors: Select the colors you want to include in the gradient.
Color Positions: Use percentages (%) to define where each color starts and stops within the gradient.