npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rn-pulsing-circle

v1.0.0

Published

A react native component to generate a pulsing circle animation

Downloads

1

Readme

license Version npm

rn-pulsing-circle

React Native component for creating an animated pulsing circle. Useful as an activity indicator. Works on iOS & Android.

Example app

image

Installation

  1. Install the component:

npm i --save rn-pulsing-circle

Usage

Import PulsingCircle:

import { PulsingCircle } from 'rn-pulsing-circle'

Use as follows:

<PulsingCircle />

You can also supply any of the following properties:

<PulsingCircle
  delay={3000}
  mainBackgroundColor={'transparent'}
  mainCircleBorder={1}
  mainCircleColor={'#6cdbd2'}
  mainCircleSize={200}
  pulseCircleBorder={1}
  pulseCircleColor={'#6cdbd2'}
  pulseCircleSize={200}
  playAnimation={true}
  toggleOnPress={false}
/>

You can wrap children components to be displayed inside the circle:

<PulsingCircle>
  <Text
    style={{
      color: 'white',
      fontSize: 48,
      fontWeight: '100',
      position: 'absolute'
    }}
  >
    $45
  </Text>
</PulsingCircle>

You can define an onPress to fire your method when the circle is pressed:

handlePress = () => {
  alert('You pressed me')
}

render() {
  return (
    <PulsingCircle onPress={() => this.handlePress()} />
  )
}

Finally, you can manually trigger animation start, animation stop and toggle animation by adding a ref like so:

<PulsingCircle ref="myCircle" onPress={() => this.handlePress()} />
this.refs.myCircle.startAnimation() // Will force the animation to start
this.refs.myCircle.stopAnimation() // Will force the animation to stop
this.refs.myCircle.toggleAnimation() // if the animation is running, will stop the animation. Otherwise will start the animation

Configuration

You can configure the passing by following props:

  • delay - number of milliseconds to pause between animation cycles (default: 3000)
  • backgroundColor - color of the background for the component. If unspecified, no background will be rendered
  • mainCircleBorder - border thickness of the primary circle (default: 1)
  • mainCircleColor - color of the primary circle (default: #6cdbd2)
  • mainCircleSize - height/width of the primary circle (default: 200)
  • pulseCircleBorder - border thickness of the pulsating circle (default: 1)
  • pulseCircleColor - color of the pulsating circle (default: #6cdbd2)
  • pulseCircleSize - height/width of the primary circle (default: 200)
  • playAnimation - indicates whether the animation should be playing or not (default: true)
  • toggleOnPress - indicates if the animation should toggle on/off when clicked (default: false)
  • onAnimationComplete - you can pass a callback function that will be invoked when the animation cycle completes.
  • onPress - you can pass a callback function that will be invoked when the component is pressed. )

Author

Larry J Rutledge ([email protected])

License

MIT

Special thanks

Special thanks to Spencer Carli for helping me understand React Native Animations and getting me a long ways down the road to making this specific animation work correctly.