The js is not minified so it is readable. See button.js.
For a demo of buttons in toolbars, see the toolbar sample.