Referenceslider

<slider>

<slider> is an Input component that renders a draggable selection bar for graphical user input of a single value.

Attributes and Properties

Attributes for <slider>
AttributeTypeValues
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
Props for <slider name="s">
PropertyType
$s.disabledboolean
$s.displayDecimalsinteger
$s.displayDigitsinteger
$s.displaySmallAsZeronumber
$s.fixedboolean
$s.fixLocationboolean
$s.fromnumber
$s.heightcomponentSize
$s.hiddenboolean
$s.items
$s.labellabel
$s.labelIsNameboolean
$s.numItemsinteger
$s.padZerosboolean
$s.showControlsboolean
$s.showTicksboolean
$s.showValueboolean
$s.stepnumber
$s.tonumber
$s.value
$s.widthcomponentSize

Example: Default <slider>

The range for a default <slider> is from 00 to 1010. 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 00 to 1010.


Attribute Example: step

The step attribute can be used to customize the incremental step size for the <slider>. The default step is 11.


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.