Slider
Drag handles to adjust a number or range intuitively.
Usage guide
#Use to adjust approximate values quickly, such as volume or brightness. Input Number is better for exact numeric entry.
One value
Set the range with min and max, and the increment with step.
A range between two values
Enable range and pass a two-value array to rangeValue to adjust both endpoints.
Examples
#Feature examples
#Choose a feature from 20 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.
No matching features.
API reference
#Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.
<sy-slider>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
number | 0 | Slider minimum value. | |
number | 100 | Slider maximum value. | |
number | 1 | Increment or decrement step size. | |
number | 0 | Current value or item identifier. | |
boolean | false | Block user interaction and keyboard focus. | |
boolean | false | Display the current value while preventing edits. | |
'default' | 'always' | 'never' | 'default' | default shows the value during interaction; always keeps it visible; never keeps it hidden. | |
'top' | 'bottom' | 'right' | 'left' | 'top' | Placement of the value tooltip. | |
{ [key: number]: string } | {} | Object mapping tick values to display labels. Pass objects and arrays as JavaScript properties. | |
boolean | false | Hide tick labels. | |
boolean | false | Select a range with two handles. | |
number[] | [] | Array of start and end values. Also enable range to apply them to two handles. Pass objects and arrays as JavaScript properties. | |
boolean | false | Reverse the slider direction. | |
string | '' | Label describing the item. | |
boolean | false | Hide the selected range's fill color. | |
boolean | false | Snap the handle to specified tick positions. | |
boolean | false | Arrange vertically. |
Events
| Event | Detail | Description |
|---|---|---|
CustomEvent<{ value?: number; min?: number; max?: number }> | Fires whenever the slider value changes (drag, click, keyboard). detail = { value } for single mode, { min, max } for range mode. |
Methods
| Method | Returns | Description |
|---|---|---|
Promise<number | { min: number; max: number }> | Return the current value or selected range. |