Sorry about the delay.
For a checkbox, it looks like that isn't working correctly because whether you check it or not, you always get back the value "on". So that's a bug! A fix will be forthcoming.
There are probably another dozen or so other ways you could create a yes/no option input. Ranging from toggle buttons, sliders, drop-downs, etc.
Perhaps the simplest however, and one that works with the existing zero-code uib-element
node is a RANGE input that only allows 2 values. Here is the simple input for that:
msg._ui = [
{
"id": "r5-range",
"type": "range",
"required": false,
"label": "Range (0-1):",
"value": "0",
"min": 0,
"max": 1
}
]
Doesn't maybe look too pretty. However, you can do some styling of a range input.
Another work-around would be to add a drop-down with 2 choices. To do that, you can try adding this flow fragment after the output from the uib-element
node but before sending to uibuilder (because drop-downs are not yet included in the uib-element
form input types).
[{"id":"0ba6f665b66f8e40","type":"template","z":"3badb0a6906eef7f","g":"f6154314aee80d24","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<label for=\"on-off-1\">On/Off:</label>\n<select name=\"on-off-1\" id=\"on-off-1\" onchange=\"this.dataset.newValue = this.value\" onfocus=\"this.dataset.oldValue = this.value\">\n <option value=\"blank\"></option>\n <option value=0>On</option>\n <option value=1>Off</option>\n</select>","output":"str","x":680,"y":420,"wires":[["4f91975ee70aa6ee"]]},{"id":"4f91975ee70aa6ee","type":"uib-element","z":"3badb0a6906eef7f","g":"f6154314aee80d24","name":"","topic":"","elementtype":"html","parent":"#sform1 > form","parentSource":"","parentSourceType":"str","elementid":"dropdown1","elementId":"","elementIdSourceType":"str","heading":"","headingSourceType":"str","headingLevel":"h2","position":"first","positionSourceType":"str","confData":{},"x":920,"y":420,"wires":[["534ccd905d0adc50"]]}]
Note that the flow assumes you are using the "uib-element tests" example flow. Adjust things according to your form settings.
All I've done there is to create a label and drop-down using HTML and appended that to the zero-code output. You could, of course, adjust the template node to use some variables so that you could re-use it.
If you need something more, let me know there are hundreds of examples of on/off switches on the Internet so if you find one you like or can describe something, I'd happily create it using the low-code output so that it can easily be incorporated manually in your flows now but I can also add it to the next release of uibuilder in the uib-element
form type.