2018-04-24 21:05:05 +00:00
caption: range
created: 20171102134825376
2018-04-25 13:29:26 +00:00
modified: 20180425132848231
2018-04-24 21:05:05 +00:00
tags: Widgets
title: RangeWidget
2018-04-25 13:29:26 +00:00
type: text/vnd.tiddlywiki
2018-04-24 21:05:05 +00:00
! Introduction
2019-10-04 14:50:32 +00:00
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.
2018-04-24 21:05:05 +00:00
! 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|Current Tiddler]]) |
2019-10-04 14:50:32 +00:00
|field |The field of the //tiddler// bound to the range slider|
2018-04-24 21:05:05 +00:00
|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 |The default value displayed if the field is missing or empty.|
2019-10-04 14:50:32 +00:00
|class |CSS classes to be assigned to the label around the range slider |
2018-04-25 13:29:26 +00:00
! Examples
!! Range -1 to 10
<$macrocall $name='wikitext-example-without-html'
src="""<$range tiddler="$:/_RangeDemo/1" min="-1" max="10" default="1" increment="1"/> {{$:/_RangeDemo/1}}"""/>
!! Range 0 to 1
<$macrocall $name='wikitext-example-without-html'
src="""<$range tiddler="$:/_RangeDemo/2" min="0" max="1" default=".01" increment=".01"/> {{$:/_RangeDemo/2}}"""/>