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

react-gauge-ultimate

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-gauge-ultimate

Powerful gauge chart for React

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-gauge-ultimate

Powerful gauge chart for React

NPM JavaScript Style Guide react-gauge-ultimate Banner

Install

npm i react-gauge-ultimate

or

yarn add react-gauge-ultimate

Usage

import React from 'react'

import { Gauge } from 'react-gauge-ultimate'
import 'react-gauge-ultimate/dist/index.css'

const App = () => {
  return (
    <Gauge
      id='gauge id'
      className='Gauge'
      label='label text'
      percent={1}
      darkMode={false}
    />
  )
}

export default App

API

Warning: Do not use the same id for multiple charts, as it will put multiple charts in the same container

NamePropTypeDescriptionDefault value
idPropTypes.string.isRequiredUsed for the identification of the div surrounding the chart
classNamePropTypes.stringAdd className to the div container
stylePropTypes.objectAdd style to the div container{ width: '100%' }
darkModePropTypes.boolSet dark mode style to Gaugefalse
marginInPercentPropTypes.numberMargin for the chart inside the containing SVG element0.05
cornerRadiusPropTypes.numberCorner radius for the elements in the chart6
nrOfLevelsPropTypes.numberThe number of elements displayed in the arc3
percentPropTypes.numberThe number where the pointer should point to (between 0 and 1)0.4
labelPropTypes.stringThe text that displays above the percent''
arcPaddingPropTypes.numberThe distance between the elements in the arc0.05
arcWidthPropTypes.numberThe thickness of the arc0.2
colorsPropTypes.arrayAn array of colors in HEX format displayed in the arc["#00FF00", "#FF0000"]
textColorPropTypes.stringThe color of the text"#FFFFFF"
needleColorPropTypes.stringThe color of the needle triangle"#464A4F"
needleBaseColorPropTypes.stringThe color of the circle at the base of the needle"#464A4F"
hideTextPropTypes.boolWhether or not to hide the percentage displayfalse
arcsLengthPropTypes.arrayAn array specifying the length of each individual arc. If this prop is set, the nrOfLevels prop will have no effectnone
animatePropTypes.boolWhether or not to animate the needle when loadedtrue
animDelayPropTypes.numberDelay in ms before starting the needle animation500
animateDurationPropTypes.numberDuration in ms for the needle animation3000
formatTextValuePropTypes.funcFormat you own text value (example: value => value+'%')null

License

MIT © boof-tech

FAQs

Package last updated on 19 Jul 2022

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