Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-npm-circular-status-indicator

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-npm-circular-status-indicator

A react component to display an analysis or observation result in a coloured Circular Percentage Indicator

  • 1.11.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

react-npm-circular-status-indicator

A React component to display coloured animated circular progress bar with percentage variations.

npm Version Build Status

Overview

A minimal usage will just display coloured circular percentage bar with animation.

let percentage = 75
<CircularStatusIndicator>{percentage}</CircularStatusIndicator>;

The color of the bar by default would be based on the range of the percentage, so:

RangeDefault
0-25red
26-50yellow
51-75blue
76-100green

This might have a default height/width of 100px

But User can override:

let percentage = 75
<CircularStatusIndicator radius={50}>{percentage}</CircularStatusIndicator>;

Other options can be passed in as inverted like so:

let percentage = 75
<CircularStatusIndicator inverted={true}>{percentage}</CircularStatusIndicator>;

In this case, the colors would be reversed;

RangeDefault
0-25green
26-50blue
51-75yellow
76-100red

final possibility is where the colour of the bar is passed in as a prop:

<CircularStatusIndicator colour={'#FFC000'}>75</CircularStatusIndicator>

The only additional prop needed would be a text label, 50% font size of the percentage, placed above it and centered of course

<CircularStatusIndicator radius='{200}' textLabel={'Hello!'}>75</CircularStatusIndicator>

Features

  • Display circular percentage bar.
  • Dispay default coloured bar according to prercentage.
  • Dispay inverted coloured bar according to prercentage.
  • Display colured percentage bar according to color pass through params.
  • Display colured percentage bar according to radius passed through params .
  • Display percentage label inside the circle with result label passed through params
  • Runs in the browser and Node.js.
  • Built on standards.

Example

import React,{Component} from 'react';
import ReactDOM from 'react-dom';
import CircularStatusIndicator from 'react-npm-circular-status-indicator';

class App extends Component {
  render() {
    return(
      <div>
      <h2>Circular Status Indicator</h2>
      <CircularStatusIndicator textLabel={'Default'}>80</CircularStatusIndicator>
      <CircularStatusIndicator inverted={true} textLabel={'Inverted'}>80</CircularStatusIndicator>
      <CircularStatusIndicator colour={'#04c3ff'} textLabel={'Colour'}>80</CircularStatusIndicator>
      <CircularStatusIndicator radius={200} textLabel={'Radius'}>70</CircularStatusIndicator>
      <CircularStatusIndicator radius={50}>40</CircularStatusIndicator>
      </div>
    );
  }
}

ReactDOM.render(<App />,document.querySelector('.container'));

Technology Stack:

  • react
  • mocha

Usage:

Clone the repo as a new project:

git clone https://github.com/lobdev/react-npm-circular-status-indicator <circular-status-indicator>

Start Server:

First you have to replace the lib/component/circular_status_indicator.js to server.js in package.json
cd circular-status-indicator
npm i
npm start

Run App:

npm start command automatically initiate browser at 3000 port
http:://localhost:3000

Run tests:

cd circular-status-indicator
npm i
npm test

Developer Notes:

Make sure you configure your editor/IDE to use:

.editorconfig
.eslintrc

Keywords

FAQs

Package last updated on 29 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc