PhotonUI logo

PhotonUI

A javascript framework to create user interfaces

ToggleButton

Class Reference

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
var toggle = new photonui.ToggleButton({
value: false,
text: "Value: off",
buttonColor: "red",
callbacks: {
"value-changed": function(widget, value) {
widget.text = "Value: " + ((value) ? "on" : "off");
widget.buttonColor = (value) ? "green" : "red";
}
}
});

photonui.domInsert(toggle, "demo");