<slider>
<slider>
is an Input
component that renders a draggable selection bar for graphical user input of a single value.
Attributes and Properties
Attribute | Type | Values |
---|---|---|
bindValueTo = "…" | ||
displayDecimals = "…" | integer | |
displayDigits = "…" | integer | |
displaySmallAsZero = "…" | number | |
from = "…" | number | |
height = "…" | componentSize | |
initialValue = "…" | ||
labelIsName = "…" | boolean | "true" "false" |
padZeros = "…" | boolean | "true" "false" |
showControls = "…" | boolean | "true" "false" |
showTicks = "…" | boolean | "true" "false" |
showValue = "…" | boolean | "true" "false" |
step = "…" | number | |
to = "…" | number | |
type = "…" | "number" "text" | |
width = "…" | componentSize |
Property | Type |
---|---|
$s.disabled | boolean |
$s.displayDecimals | integer |
$s.displayDigits | integer |
$s.displaySmallAsZero | number |
$s.fixed | boolean |
$s.fixLocation | boolean |
$s.from | number |
$s.height | componentSize |
$s.hidden | boolean |
$s.items | |
$s.label | label |
$s.labelIsName | boolean |
$s.numItems | integer |
$s.padZeros | boolean |
$s.showControls | boolean |
$s.showTicks | boolean |
$s.showValue | boolean |
$s.step | number |
$s.to | number |
$s.value | |
$s.width | componentSize |
Example: Default <slider>
The range for a default <slider>
is from to . The current value of the slider is shown, by default, in
the upper left corner of the slider bar. Referencing the named slider using the $name
notation renders its current value.
Example: A labeled <slider>
A <slider>
can be given a <label>
child, which renders above the slider to the
left of the current value of the <slider>
.
Attribute Example: type
There are two types of sliders, “number
” and “text
”, which can be
specified using the type
attribute. The text type requires <text>
children, and
frames them in a sequential list on the <slider>
when it is rendered.
Attribute Example: initialValue
Using the initialValue
attribute, the slider can be set to an initial value
occuring in the interior of the slider’s range. Without this attribute, the
initial value of the slider defaults to the starting value.
Attribute Example: width
The default width
for a <slider>
is 300 pixels, in absolute measurement; this
value can be adjusted with the width
attribute.
Attribute Example: labelIsName
If the labelIsName
attribute is specified, a default label is displayed above the slider, with
the name of the slider taken as its label.
Attribute Example: showTicks
By default, the showTicks
attribute is set to true
. If showTicks
is set to false
, no values
are rendered on the slider bar.
Attribute Example: showValue
By default, the showValue
attribute is set to true
, and the current value of the slider is
automatically rendered directly above the bar on the left side. If showValue
is set to “false
”,
no value is rendered above the slider bar as the user drags the point.
Attribute Example: from / to
The from
and to
attributes can be used to customize the range for the <slider>
. The default
range is from to .
Attribute Example: step
The step
attribute can be used to customize the incremental step size for the <slider>
. The default
step is .
Property Example: Attributes as properties
The attributes of <slider>
listed above are also accessible as properties.
Property Example: items
The items
property of <slider>
returns a list of all the possible values in
the slider’s range for a text
type <slider>
.
Property Example: numItems
The numItems
property of <slider>
returns the number of possible values
occuring in the slider’s range.