Class “Slider”
Object > NativeObject > Widget > Slider
A widget representing a numeric value as an movable indicator on a horizontal line.
Type: | Slider extends Widget |
Constructor: | public |
Singleton: | No |
Namespace: | tabris |
Direct subclasses: | None |
JSX Support: | Element: <Slider/> Parent Elements: <Canvas/> , <Composite/> , <Page/> , <RefreshComposite/> , <ScrollView/> , <Stack/> , <Tab/> Child Elements: Not Supported Text Content: Not supported |
Examples
JavaScript
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 | Description |
---|---|---|
properties | Properties<Slider> |
Sets all key-value pairs in the properties object as widget properties. Optional. |
Properties
maximum
The maximum value.
Type: | number |
Default: | 100 |
Settable: | Yes |
Change Event: | maximumChanged |
minimum
The minimum value.
Type: | number |
Default: | 0 |
Settable: | Yes |
Change Event: | minimumChanged |
selection
The actual value.
Type: | number |
Default: | 0 |
Settable: | Yes |
Change Event: | selectionChanged |
tintColor
The color used to display the current selection.
Type: | ColorValue |
Settable: | Yes |
Change Event: | tintColorChanged |
Events
select
Fired when the selection property is changed by the user.
EventObject Type: SliderSelectEvent<Slider>
Property | Type | Description |
---|---|---|
selection | number |
The new value of selection. |
Change Events
minimumChanged
Fired when the minimum property has changed.
EventObject Type: PropertyChangedEvent<Slider, number>
Property | Type | Description |
---|---|---|
value | number |
The new value of minimum. |
maximumChanged
Fired when the maximum property has changed.
EventObject Type: PropertyChangedEvent<Slider, number>
Property | Type | Description |
---|---|---|
value | number |
The new value of maximum. |
selectionChanged
Fired when the selection property has changed.
EventObject Type: PropertyChangedEvent<Slider, number>
Property | Type | Description |
---|---|---|
value | number |
The new value of selection. |
tintColorChanged
Fired when the tintColor property has changed.
EventObject Type: PropertyChangedEvent<Slider, ColorValue>
Property | Type | Description |
---|---|---|
value | ColorValue |
The new value of tintColor. |