Slider
import {Slider} from 'cx/widgets';The Slider widget allow selecting numerical values by dragging the slider handle.
<div layout={LabelsLeftLayout}>
<Slider label="Standard" value-bind="$page.to" valueTooltip={{
text:{tpl: '{$page.to:n;2}' },
placement: 'up'
}}
wheel
increment={2.5} />
<Slider label="Stepped" from-bind="$page.from" step={10} wheel increment={10} />
<Slider label="Range" from-bind="$page.from" to-bind="$page.to" />
<Slider label="Disabled" from-bind="$page.from" to-bind="$page.to" disabled />
</div>
<Slider vertical from-bind="$page.from" to-bind="$page.to" step={10} rangeStyle="background:lightsteelblue"/>
<Slider vertical from-bind="$page.from" to-bind="$page.to" rangeStyle="background:lightgreen"/>
<Slider vertical from-bind="$page.from" to-bind="$page.to" rangeStyle="background:lightyellow"/>| Property | Description | Type |
|---|---|---|
from | Low value of the slider range. | number |
increment | Value increment/decrement, when controlling the slider with mouse wheel. Default value is set to | number |
maxValue | Maximum allowed value. Default is | number |
minValue | Minimum allowed value. Default is | number |
step | Rounding step. | number |
to | High value of the slider range. | number |
wheel | When set to | boolean |
autoFocus | Set to | boolean |
baseClass | Base CSS class to be applied to the field. Defaults to | string |
class | Additional CSS classes to be applied to the element. If an object is provided, all keys with a "truthy" value will be added to the CSS class list. | string/object |
disabled | Defaults to | boolean |
emptyText | Text to be rendered in view mode when the field is empty. | string |
enabled | The opposite of | boolean |
error | Used for validation. If error evaluates to non-null, the field is marked in red. | string |
fromTooltip | Configuration of the tooltip shown on the | string/object |
handleStyle | Style object to be applied on the handle. | string/object |
help | Additional content to be displayed next to the field. This is commonly used for presenting additional information or validation errors. | string/config |
helpPlacement | Set to | string |
helpSpacer | Indicates that | boolean |
id | Id to be used on rendered input. | string |
inputAttrs | Additional attributes that should be rendered on the input element.
E.g. | object |
inputClass | Additional CSS class applied to the input element. Used for setting visual elements, such as borders and backgrounds. | string/object |
inputStyle | Style object applied to the input element. Used for setting visual elements, such as borders and backgrounds. | string/object |
invert | Invert vertical slider behavior. Set this to | boolean |
label | Field label. For advanced use cases, see Labels. | string/config |
labelClass | Additional CSS class to be passed to the label object. | string |
labelPlacement | Set to | string |
labelStyle | Additional CSS styles to be passed to the label object. | string/object |
mod | Appearance modifier. For example, | string/array |
mode | Either | string |
outerLayout | Defines the outer layout which wraps the widget. | widget |
placeholder | Default text displayed when the field is empty. | string |
putInto | Used with outer layouts. Specifies the name of the content placeholder which should render the widget. | string |
rangeStyle | Style object to be applied on the selected axis range. | string/object |
readOnly | Defaults to | boolean |
required | Defaults to | boolean |
style | Style object applied to the wrapper div. Used for setting the dimensions of the element. | string/object |
tabIndex | Custom tab index to be set on the field. | string |
tabOnEnterKey | Set to | boolean |
toTooltip | Configuration of the tooltip shown on the | string/object |
tooltip | Tooltip configuration. For more info see Tooltips. | string/object |
trackFocus | If set to | boolean |
validationMode | Defines how to present validation errors. Default mode is | string |
validationParams | An structured binding for additional validation parameters. Useful if validation depends on values
from other fields, e.g. confirm password. Calculated value is passed as the third argument to | structure |
vdomKey | Key that will be used as the key when rendering the React component. | string |
vertical | Set to | boolean |
viewMode | Set to | boolean |
visible | Visibility of the widget. Defaults to | boolean |
visited | Validation errors are not shown until the user visits the field. Setting this field to | boolean |