Slider

Drag handles to adjust a number or range intuitively.

Live preview
Interact with the component to see results here.
View code
HTML
<sy-slider
  value="40"
  min="0"
  max="100"
  step="5"
  showtooltip="always"
  label="Adjust value"
  id="sample"
  style="width:100%"
></sy-slider>

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.

Feature examples

#

Choose a feature from 20 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.

Usage examples · Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Property · Disabled

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Hide Marks

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Hide Track Fill

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Label

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Marks

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Max

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Min

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Range Value

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Range

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Readonly

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Reverse

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Show Tooltip

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Snap To Marks

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Step

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Tooltip Placement

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Value

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Vertical

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Methods · getValue

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Events · Changed

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

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 / PropertyTypeDefaultDescription
number0Slider minimum value.
number100Slider maximum value.
number1Increment or decrement step size.
number0Current value or item identifier.
booleanfalseBlock user interaction and keyboard focus.
booleanfalseDisplay 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.

booleanfalseHide tick labels.
booleanfalseSelect 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.

booleanfalseReverse the slider direction.
string''Label describing the item.
booleanfalseHide the selected range's fill color.
booleanfalseSnap the handle to specified tick positions.
booleanfalseArrange vertically.

Events

EventDetailDescription
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

MethodReturnsDescription
Promise<number | { min: number; max: number }>Return the current value or selected range.