Parameters you can pass

ParameterData typeDescription
namestringName of the element to be used in a form
idstringButton element ID
class_namestringHere you can add your own class (in addition to system classes)
blueboolPass true if you need a blue button (it's gray by default)

It supports multiple states by triggering jQuery events on a button element with the .button-input class.

var $button = $('.button-input');

// starts rotating the loader in the button
// usually called before making an ajax request
$button.trigger('button:load:start');

// stops behavior from above
$button.trigger('button:load:stop');

// activate the button if there are changes in the form
$button.trigger('button:save:enable');

// activate the button if there are no changes in the form
$button.trigger('button:save:disable');

Standard button

  self.render({ ref: '/tmpl/controls/button.twig' }, {
    name: 'button',
    text: 'Default button'
  });

Active button

There should be just one active button on the interface, usually this is a button to save the active form.

 self.render({ ref: '/tmpl/controls/button.twig' }, {
    name: 'button',
    text: 'Save',
    blue: true
  });