1.0.0 • Published 2 months ago

react-gauges v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

react-gauges

npm

This library provides a set of reusable gauge components for use in React applications.

Installation

To install the library, run the following command:

npm install react-gauges

Usage

To use the library in your React application, import the desired gauge component and pass in the necessary props. Here's an example of how to use the SimpleGauge component:

import { SimpleGauge } from "react-gauges";

function App() {
  return (
    <div>
      <SimpleGauge value={50} />
    </div>
  );
}
import { SimpleGauge } from "react-gauges";

function App() {
  return (
    <div>
      <SimpleGauge value={50} borderType="square" indicatorVisible={false} />
    </div>
  );
}
import { SimpleGauge } from "react-gauges";

function App() {
  return (
    <div>
      <SimpleGauge value={50} isTotal={true} />
    </div>
  );
}

Options

OptiontypeDescriptionExample
valuenumberThe value to display on the gaugevalue={75}
minLimitnumberThe minimum value of the gaugeminLimit={0}
maxLimitnumberThe maximum value of the gaugemaxLimit={100}
barColorstringThe color of the gauge barbarColor="#00ff00"
barBaseColorstringThe color of the gauge bar basebarBaseColor="#000000"
barWidthnumberThe width of the gauge barbarWidth={10}
labelColorstringThe color of the gauge labellabelColor="#000000"
labelFontSizestringThe font size of the gauge labellabelFontSize="1rem"
labelFontFamilystringThe font family of the gauge labellabelFontFamily="Arial"
labelFontWeightstringThe font weight of the gauge labellabelFontWeight="bold"
labelTemplatestringThe template of the gauge labellabelTemplate="{value}%"
indicatorColorstringThe color of the gauge indicatorindicatorColor="#000000"
indicatorVisiblebooleanWhether or not the gauge indicator is visibleindicatorVisible={true}
isTotalbooleanWhether or not the gauge is a totalisTotal={true}
borderTypestringThe type of border, "round", "square", "butt"borderType="square"

License

MIT © kevinjpuscan

1.0.0

2 months ago

0.0.4

2 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago