virtual-progress

Animated, randomized progress bar built with virtual-dom

Usage no npm install needed!

<script type="module">
  import virtualProgress from 'https://cdn.skypack.dev/virtual-progress';
</script>

README

virtual-progress Build Status

Animated, randomized progress bar built with virtual-dom

Install

$ npm install --save virtual-progress

Usage

var Progress = require('virtual-progress')
var state = Progress()

var vtree = Progress.render(state)

API

Progress([data]) -> function

data

Required Type: object

Initial state data for the component. Returns an observable state ({active, value}.

Progress.start(state) -> undefined

Starts the progress meter, ticking the value every 200ms.

Progress.stop(state) -> undefined

Stops the progress meter.

Progress.reset(state) -> undefined

Stops the progress meter and resets it to {value: 0}.

Progress.done(state) -> undefined

Animates the progress meter to its final state ({value: 1, active: false}).

Progress.onComplete(state, listener) -> function

The listener is called when the progress bar's value is 1 and its transition ends.

Returns an unlisten function.

License

MIT © Ben Drucker