The example shows how to use the ProgressBar class. The js is not minified so it is readable. See progress-bar.js.
Basic Progress Bar
Deferred rendering, dynamic show/hide and built-in progress text:
Rendered on page load, left-aligned text and % width:
Wait for a long operation to complete (example will stop after 5 secs):
Rendered like Windows XP with custom progress text element: