New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-progress-circle-gradient

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-progress-circle-gradient

React Native component for making animated circular progress charts with an angular gradient using react-native-skia

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-native-progress-circle-gradient

license Version npm

An animated progress circle with an angular gradient. The differentiator between this package and other React Native animated circular progress charts with a gradient is that the start color can be different than the stop color.

This package has only 2 dependencies (@shopify/react-native-skia and color-interpolate). It has 0 peer dependencies and so does not require react-native-reanimated to also be installed, linked and configured for your project.

This project is inspired by this YouTube tutorial.

Installation

npm install react-native-progress-circle-gradient

or

yarn add react-native-progress-circle-gradient

Props

PropDescriptionTypeDefaultRequired
colorsThe color hex values array to be used for the angular gradientString[]N/A
backgroundColorThe color hex value for the remaining progressString'#F0F8FF'
durationThe duration of the animation in millisecondsNumber1250
easingThe easing options for the animation: 'cubic', 'ease', 'linear', 'quad'String1250
granularitySmaller progress circle charts can use a smaller granularity to increase performanceNumber200
onAnimationFinishCallback for when animation reaches 100%FunctionN/A
percentageCompleteThe percentage of progress completed ranging from 0-100Number0
radiusThe radius of the progress circle in points, measured from the center of the strokeNumber100
rotationThe rotation of the progress circle in degreesNumber0
strokeWidthThe thickness of the progress circleNumber30

Usage

import { CircularProgress } from 'react-native-progress-circle-gradient';

// ...

<CircularProgress
  backgroundColor={'#1F1B24'}
  radius={100}
  strokeWidth={20}
  percentageComplete={percentageComplete}
  colors={['#0000FF', '#00FF00']}
/>;

import { CircularProgress } from 'react-native-progress-circle-gradient';

// ...

<CircularProgress
  backgroundColor={'#1F1B24'}
  radius={128}
  strokeWidth={20}
  percentageComplete={progress}
  colors={['#0000FF', '#00FF00']}
  duration={3000}
  onAnimationFinish={() => {
    Alert.alert('Animation has finished!');
  }}
/>;

<CircularProgress
  backgroundColor={'#1F1B24'}
  radius={100}
  strokeWidth={20}
  percentageComplete={percentageComplete}
  colors={['#0000FF', '#00FF00', '#FF0000']}
/>

<CircularProgress
  backgroundColor={'#1F1B24'}
  radius={100}
  strokeWidth={20}
  percentageComplete={percentageComplete}
  colors={['#0000FF', '#00FF00', '#0000FF']}
  rotation={270}
/>

Roadmap

  • Add support for text once default system fonts become available in this PR
  • Add support for children components

Contributing

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

License

MIT


Made with create-react-native-library

Keywords

FAQs

Package last updated on 21 Jun 2023

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