@computools/react-native-circular-progress

react-native-circular-progress

Usage no npm install needed!

<script type="module">
  import computoolsReactNativeCircularProgress from 'https://cdn.skypack.dev/@computools/react-native-circular-progress';
</script>

README

@computools/react-native-circular-progress

@computools/react-native-circular-progress

npm version

Installation

npm install @computools/react-native-circular-progress

Usage

import { CircularProgress } from '@computools/react-native-circular-progress';

// ...

const percentRatio = 100;
const totalDeaths = 69;
const totalConfirmed = 100;

export const App = () => (
  <SafeAreaView style={styles.container}>
    <CircularProgress
      size={64}
      width={3}
      fill={Math.round((totalDeaths / totalConfirmed) * percentRatio)}
      tintColor={'yellow'}
      dangerTintColor={'red'}
      dangerValue={50}
      lineCap="round"
      backgroundColor={'silver'}
    >
      {(fill: number) => <Text>{fill}%</Text>}
    </CircularProgress>
  </SafeAreaView>
);

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
});

Example

react-native-chart

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT