Introduction
The range widget displays an HTML <input type="range"> that reflects a given tiddler field numeric value. Adjusting the range slider sets the tiddler field to the value.
Content and Attributes
The content of the <$range> widget is ignored.
| Attribute | Description |
|---|---|
| tiddler | Title of the tiddler to manipulate (defaults to the current tiddler) |
| field | The field of the tiddler bound to the range slider |
| index | Introduced in v5.1.22 The index of the tiddler, a DataTiddler, to which the radio button is bound |
| min | The minimum value to be able to be set by the <$range> widget |
| max | The maximum value to be able to be set by the <$range> widget |
| increment | The minimum amount by which a value may be changed. Defaults to 1 |
| default | If the field is missing or empty this is the default position for the widget handle relative to the min and max values |
| class | CSS classes to be assigned to the label around the range slider |
| actions | Introduced in v5.1.23 Optional, A string containing ActionWidgets to be triggered when the value changes. The variable: actionValue is available for all actions. The variable: actionValueHasChanged is always yes here. |
| actionsStart | Introduced in v5.1.23 Optional, A string containing ActionWidgets to be triggered when the "handle" is clicked. The variable: actionValueHasChanged is always no here |
| actionsStop | Introduced in v5.1.23 Optional, A string containing ActionWidgets to be triggered when the "handle" is released. The variable: actionValueHasChanged is yes, if the new-value is different to the start-value |
| disabled | Introduced in v5.1.23 Optional, disables the range input if set to "yes". Defaults to "no" |
| tabindex | New in v5.3.7 Optional. Sets the tabindex attribute of the HTML select element to the given value |
| data-* | New in v5.3.2 Optional data attributes to be assigned to the <input> HTML element |
| style.* | New in v5.3.2 Optional CSS properties to be assigned to the <input> HTML element |
Examples
Range -1 to 10
| title | Output |
| value | 1 |
1
Range 0 to 1
| title | Output |
| value | 0.01 |
0.01
Using Actions
The sliders store their values in the integer-value and fractional-value fields of Output. Enable "Show log" to inspect the actions fired when dragging starts, the value changes, and dragging stops. Each entry includes the event, actionValue, and actionValueHasChanged. Entries in the log tiddler are numbered so that events fired within the same millisecond do not overwrite each other. Use "Clear Log" to reset the log.
| title | Output |
| fractional-value | 0.01 |
| integer-value | 1 |
| show-log | no |
1
0.01
JSON data indexes
The index attribute stores the slider value in a JSON property. Move the slider to update volume, or use the button to update the property and watch the slider follow. The label property is preserved.
| title | Output |
Volume: 0.5
Other property: Speaker