Class “Slider”

Object > NativeObject > Widget > Slider

A widget representing a numeric value as an movable indicator on a horizontal line.

Slider on Android
Android
Slider on iOS
iOS
Constructor public
Singleton No
Namespace tabris
Direct subclasses None
JSX support Element: <Slider/>
Parent element: <Composite/> and any widget extending Composite
Child elements: None
Text content: Not supported

Example

import {Slider, contentView} from 'tabris';

new Slider({
  left: 16, right: 16,
  selection: 50
}).onSelect(({selection}) => console.log(`Slider is at ${selection}`))
  .appendTo(contentView);

See also:

Constructor

new Slider(properties?)

Parameter Type Optional Description
properties Properties<Slider> Yes Sets all key-value pairs in the properties object as widget properties.

Properties

maximum

The maximum value.

Type number
Default 100
Settable Yes

minimum

The minimum value.

Type number
Default 0
Settable Yes

selection

The actual value.

Type number
Default 0
Settable Yes

tintColor

The color used to display the current selection.

Type ColorValue
Settable Yes

Events

select

Fired when the selection property is changed by the user.

Parameter Type Description
selection number The new value of selection.

Change Events

minimumChanged

Fired when the minimum property has changed.

Parameter Type Description
value number The new value of minimum.

maximumChanged

Fired when the maximum property has changed.

Parameter Type Description
value number The new value of maximum.

selectionChanged

Fired when the selection property has changed.

Parameter Type Description
value number The new value of selection.

tintColorChanged

Fired when the tintColor property has changed.

Parameter Type Description
value ColorValue The new value of tintColor.