Fork me on GitHub
A lightweight, no-dependency top bar library
Download v0.1.1 (2.2 KB)

Quick Look



0. Import script

<script src="path/to/ToProgress.min.js"></script>

1. Set options (The values below are default value)

var options = {
 id: 'top-progress-bar',
 color: '#F44336', 
 height: '2px', 
 duration: 0.2

2. Get the progress bar instance

var progressBar = new ToProgress(options);

3. Play it!



new ToProgress(options[,selector])

  • options
    • id - the id of auto-created top bar element
    • color - top bar color
    • height - top bar height
    • duration - increase duration (seconds)
  • selector - valid css selector, if is defined, topbar will put on the top of the element. Only find the first element.


  • progress- percentage number


  • progress- percentage number


  • progress- percentage number