Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-topbar-progress-indicator

MoOx142.5kMIT4.1.1TypeScript support: included

topbar progress indicator React component

react, topbar, progress, progressbar, loading, loader, indicator

readme

react-topbar-progress-indicator

Build Status Version

topbar progress indicator as a React component

Will simply show() and hide() topbar when the component is respectively mounted and unmounted.

Since topbar is a singleton, using <TopBarProgress /> multiples times will take this in consideration. This means that hide() will only be called when all <TopBarProgress /> have been unmounted.

For example, if you render 2 <TopBarProgress /> and unmount one (eg: you are doing 2 async things and only once is done), hide() won't be called. You will need to have both instances unmounted.

Installation

npm install react-topbar-progress-indicator
## or
yarn add react-topbar-progress-indicator

Usage

import TopBarProgress from "react-topbar-progress-indicator";

TopBarProgress.config({
  barColors: {
    "0": "#fff",
    "1.0": "#fff"
  },
  shadowBlur: 5
});

const YourThing = () => {
  return <div>{this.state.loading && <TopBarProgress />}</div>;
};

Config

Since topbar is a singleton, you should configure via Topbar.config().

barThickness (Integer, px)

The progress bar thickness in px (default: 3).

barColors (Object { progress: color })

Object of gradient color stops used to draw the progress bar.

Example:

  barColors: {
    "0": "#f00",
    "0.5": "#0f0",
    "1.0": "#00f",
  },

shadowBlur

Integer of the shadow blur in px (default: 10).

shadowColor

String that represent the shadow color (hexa, default: #000).


Changelog

Check the changelog for more informations about recent releases. You might also find releases notes on GitHub.

Contribute

⇄ Pull requests and ★ Stars are always welcome.

Please read the contribution guidelines before contributing.

Code of Conduct

We want the community to be friendly and respectful to each other. Please read our full code of conduct so that you can understand what actions will and will not be tolerated.

License

MIT

changelog

Changelog of react-topbar-progress-indicator

4.1.1 - 2022-03-07

  • Fix TypeScript declaration: Remove unnecessary generic args #28 by @lpsinger

4.1.0 - 2020-01-31

  • Add Typescript declaration #10 by @komsitr

4.0.2 - 2019-09-30

  • Fix: avoid arrow function to improve browser compatibility

4.0.1 - 2019-08-16

  • Fix: use var instead of const/let for compatibility as this module is not transpiled

4.0.0 - 2019-08-16

  • Switch from a React class to a function with useEffect() (require React 16.8)

Internal

  • No more babel, just vanilla JS (typed with flow annotations in comments)

3.0.0 - 2019-08-16

  • React 16.9.0 compat (replace componentWillMount by componentDidMount) #5

Internal

  • Test on node 8 & 10
  • Babel 6 -> 7
  • Test ava -> jest
  • Removed eslint & nyc on the codebase (unecessary considering the non complexity of the code of this component)
  • Added prettier

2.0.0 - 2016-04-01

  • react 16 compat
  • update props type via babel-plugin-flow-react-proptypes
  • use of babel-preset-env for transpilation instead of es2015

1.0.0 - 2016-04-01

✨ Initial release