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

lazyfox-circular-countdown

v1.0.5

Published

lazyfox-circular-countdown is responsive countdown circle component for react-native. this component using react-native-svg inspire by my last project.

Downloads

15

Readme

React-native-component : lazyfox-circular-countdown

version downloads

Prerequisites

This library uses react-native-svg to render this component, Therefore this library needs to be installed AND linked into your project to work.

if there's any problem when you install this component, just trying to run react-native link react-native-svg, Other than the above dependency this library uses pure javascript and supports both iOS and Android.

Motivation

I made this library motivated by my last project, which requires a component countdown circle, whereas when I look for it on Google, there is no component that matches the apps I made, so I tried making it by myself using the svg technique.

Installation

To install this component to your react-native project, please just following this instruction bellow.

#on your root project, enter command
$ npm install --save lazyfox-circular-countdown react-native-svg

#after downlaoding the dependencies, please enter this command to linked the dependencies of react-native-svg
$ react-native link react-native-svg

Example code

To install this component to your react-native project, please just following this instruction bellow.

import React, {Component} from 'react';
import {Text, View} from 'react-native';
import LazyFoxCircularCountDown from "lazyfox-circular-countdown";

export default class App extends Component<Props> {
  render() {
    return (
      <View style={{flex:1}}>
        <Text style={{fontSize:20}}>React-native countdown circle</Text>
        <LazyFoxCircularCountDown
          ref={ref=>this.timer=ref} // component reference
          seconds={10} // how long countdown start counting
          secondsLenght={10} // maximum countdown *optional* default null
          onTimesUp={(value)=>console.log(value)} // callback when counting finish *optional* default null
          onCounting={(value)=>console.log(value)} // callback on counting *optional* default null
          circleWidth={120} // the size of circle *optional*
          strokeWidth={5} // the size of outside circle ring *optional*
          fill="#fff" //the color of inside circle *optional*
          stroke="#0B2534" // the color of outside circle ring *optional*
          backStroke="#457A80" // the color of outside circle ring path *optional*
          color="#457A80" // color of text *optional*
          centerFontSize={20} // size of text *default = 20*
         />
      </View>
    );
  }
}

if you want to start the coundown manually, you can add props isAutoStart={true} and call the method on componentDidMount or another function, you can follow this example code.

import React, {Component} from 'react';
import {Text, View} from 'react-native';
import LazyFoxCircularCountDown from "lazyfox-circular-countdown";

export default class App extends Component<Props> {
  componentDidMount=()=>{
      this.time.start();
  }
  render() {
    return (
      <View style={{flex:1}}>
        <Text style={{fontSize:20}}>React-native countdown circle</Text>
        <LazyFoxCircularCountDown
          ref={ref=>this.timer=ref} // component reference
          isAutoStart={true}
          seconds={10} // how long countdown start counting
          secondsLenght={10} // maximum countdown *optional* default null
          onTimesUp={(value)=>console.log(value)} // callback when counting finish *optional* default null
          onCounting={(value)=>console.log(value)} // callback on counting *optional* default null
          circleWidth={120} // the size of circle *optional*
          strokeWidth={5} // the size of outside circle ring *optional*
          fill="#fff" //the color of inside circle *optional*
          stroke="#0B2534" // the color of outside circle ring *optional*
          backStroke="#457A80" // the color of outside circle ring path *optional*
          color="#457A80" // color of text *optional*
          centerFontSize={20} // size of text *default = 20*
         />
      </View>
    );
  }
}

defaultProps

So you can add many properties, you can look at the list of defaultprops / properties

// Propeties 

LazyFoxCircularCountDown.defaultProps = {
  offset: 0,
  stroke: 0,
  r: 20,
  circleWidth:120,
  strokeWidth:8,
  fill:"#fff",
  stroke:"green",
  backStroke:"#0B2534",
  centerFontSize:20,
  color:"#333",
  seconds:10,
  secondsLenght:null,
  onTimesUp:()=>null,
  onCounting:()=>null,
  useDecimal:true,
  isMinutes:false,
  isSeconds:false,
  delayTime:null,
  isAutoStart:true,
  isShow:true,
  defaultValue:10,
};

Dependencies

This component using react react-native-svg

License

MIT Licences