StyleCheckUI

This provides a simple binary check box that can be styled pretty much any way you want.

Parameters

  • checkVal: ()=>boolean – a function called on each render that indicates whether the checked style should be displayed.

Attributes

  • .click( onClick:()=>void) – the onClick function will be called any time the user clicks the box.
  • .checkedStyle(style:string) – the style is the name of the css class to be used when the button is checked. This allows any of a number of symbols including image icons to be used.
  • .readonly(readonly:true) – if this is set to true then the button will be displayed but inactive and non-responsive. The default is false. This is for displaying a stylistically consistent but inactive user interface.

Examples

let ready = false;
new StyleCheckUI( ()=>{ return ready; } )
     .click(()=>{
          ready = !ready;
          ZUI.notify();
     })
     .checkedStyle("GreenStyle");