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