Slider
Description
The slider component is used to display and set a numerical value within a defined range of numbers, similar to the Spinner. A classic use case would be setting a dimming or volume value. The slider consists of a horizontal bar representing the range of values and a button that can be moved over it to set the current value.
<cv-slider min="0" max="100" format="%d %%">
<cv-address transform="DPT:5.001">1/4/1</cv-address>
<cv-icon class="decrease">ri-volume-down-line</cv-icon>
<cv-icon class="increase">ri-volume-up-line</cv-icon>
</cv-slider>
The value range is limited by the min and max attributes. The step-width attribute can be used to
specify how much the value increases/decreases when the slider is operated.
The display of the value as text above the slider can be turned off with hide-value="true" and
formatted using the format attribute.
To prevent every value change from being sent directly to the backend during operation and potentially overloading it,
the throttle-interval attribute can be used to specify the minimum time in milliseconds that must pass between two value changes.
Allowed attributes
Element |
Attribute |
|||
|---|---|---|---|---|
Name |
Content |
Description |
||
cv-slider |
format |
string |
Formatting of the value (printf syntax). |
|
min |
decimal |
Minimum value. |
||
max |
decimal |
Maximum value. |
||
step-width |
decimal |
Step with. |
||
throttle-interval |
decimal |
Defines the interval (in milliseconds) used for sending changes to the backend. |
||
hide-value |
true or false |
Controls if the value is shown a text above the slider. |
||
visible-on |
mobile or desktop |
Controls this element’s visibility by screen size. |
||
class |
string |
Add this value to the CSS class so that it can be formatted by a user provided style sheet. |
||
style |
string |
Custom CSS style rules for this widget. |
||
row |
1, 2, 3, first, middle or last |
Row number or position (first, middle, last) |
||
column |
1, 2, 3, first, middle or last |
Column number or position (first, middle, last) |
||
rowspan |
integer |
Number of rows this element spans |
||
colspan |
integer |
Number of columns this element spans |
||
Allowed child elements and their attributes
Element |
Attribute |
|||
|---|---|---|---|---|
Structure |
Name |
Content |
Description |
|
|
transform |
string |
Defines the datatype in the backend, e.g. DPT:1.001 for KNX datapoint type 1.001. |
|
mode |
disable, read, write or readwrite |
Defines if this address is only used to |
||
value |
string |
Fixed value sent to this address. |
||
on |
click, down or up |
Event on which a |
||
target |
string |
Target in the parent widget the value if this address should be use for. The possible values depend on the parent widget. |
||
format-pos |
decimal |
Position for format string when multiple addresses are used. |
||
qos |
decimal |
Only MQTT: QoS |
||
retain |
true or false |
Only MQTT: retain flag |
||
selector |
string |
Only MQTT: JSON selector |
||
backend |
string |
Optional name of the backend this address belongs to. |
||
mapping |
string |
Map the bus value to a different value, text or symbol for displaying. See also mapping |
||
format |
string |
Formatting of the value (printf syntax). |
||
delay |
positiveInteger |
Optional delay in milliseconds that a write-request to this address is delayed. |
||
send-mode |
on-change or always |
Usually the elements that are using this address receive an update-event only when that value hast changed ( |
||
|
string |
The GA (like: 12/0/7) for KNX-backends, the item name for openHAB-backend or the MQTT topic |
||
Element |
Attribute |
|||
|---|---|---|---|---|
Structure |
Name |
Content |
Description |
|
|
size |
small, large, x-large, xx-large or xxx-large |
Defines the size of the icon. |
|
color |
string |
Icon color. |
||
visible-on |
mobile or desktop |
Controls this element’s visibility by screen size. |
||
class |
string |
Add this value to the CSS class so that it can be formatted by a user provided style sheet. |
||
style |
string |
Custom CSS style rules for this widget. |
||
|
string |
|||