A highly customizable and easy-to-use speedometer component for React Native. Perfect for integrating stylish speedometers or gauges into your app.
- Simple, customizable speedometer display.
- Supports dynamic value changes.
- Customizable ring color, needle color, size, and more.
- Easy integration with your React Native projects.
To install this package, run:
npm install react-native-turbo-meter --saveor if you're using yarn:
yarn add react-native-turbo-meterYou can easily add the Turbo Meter component to your project like this:
import React from 'react';
import { View, Text } from 'react-native';
import TurboMeter from 'react-native-turbo-meter';
const App = () => {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Turbo Meter Demo</Text>
<TurboMeter value={75} />
</View>
);
};
export default App;The TurboMeter component is highly customizable to match the needs of your design. You can adjust the following props to control its appearance:
| Prop | Type | Default | Description |
|---|---|---|---|
value |
number |
0 |
The current value of the speedometer (0 to 100). |
max |
number |
100 |
Maximum value for the speedometer. |
size |
number |
200 |
The size of the speedometer. |
width |
number |
15 |
Width of the speedometer ring. |
ringColor |
string |
#00ff00 |
Color of the speedometer ring. |
needleColor |
string |
#ff0000 |
Color of the needle. |
backgroundColor |
string |
#ffffff |
Background color of the speedometer. |
fontSize |
number |
30 |
Font size for the label in the center. |
<TurboMeter
value={60}
max={120}
size={250}
width={20}
ringColor="#3498db"
needleColor="#e74c3c"
backgroundColor="#ecf0f1"
fontSize={40}
/>- Type:
number - Default:
0 - Description: Sets the current value of the speedometer (range 0 to
max).
- Type:
number - Default:
100 - Description: The maximum value of the speedometer, used to scale the needle.
- Type:
number - Default:
200 - Description: Controls the overall size of the speedometer (in pixels).
- Type:
number - Default:
15 - Description: The width of the speedometer ring.
- Type:
string - Default:
#00ff00 - Description: The color of the outer ring (use any valid CSS color).
- Type:
string - Default:
#ff0000 - Description: The color of the needle.
- Type:
string - Default:
#ffffff - Description: The background color of the speedometer area.
- Type:
number - Default:
30 - Description: The font size of the center value displayed.
We welcome contributions to react-native-turbo-meter! If you'd like to help improve this project, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Open a Pull Request with a detailed description of your changes.
MIT License. See the LICENSE file for more details.
- Special thanks to the creators and contributors of
react-native-turbo-meterfor making this project possible. - Inspired by other great React Native UI components.