A two-state button that can be not only clicked but also pressed. Hence, it has two states - pressed and unpressed (initial), which makes it look like Checkbox that also has two states (checked and unchecked).
Toggle values can be defined separately for each state.
{
view:"toggle", type:"icon", name:"s4",
offIcon:"pause", onIcon:"play",
offLabel:"Disabled", onLabel:"Enabled"
}
Related sample: Toggle Button ('toggle')
The default icons are taken either from the Font Awesome or Material Design collections, depending on the used skin. You can also apply custom icons.
The Toggle type is defined by the type property. If it isn't defined, a standard button is displayed. For image toggles there exist the following types:
Types coincide with those of a standard button. Check their look and feel in the image below:
type:"icon" |
|
type:"iconTop" |
|
type:"image" |
|
type:"imageTop" |
Related sample: Toggle Image Button ('toggle')