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

react-native-progress-timer

v1.0.3

Published

React Native Timer component with progress indicators

Downloads

21

Readme

react-native-progress-timer

React Native Timer component with progress indicator

progress-timer-demo-1 progress-timer-demo-2

Installation

$ npm install --save react-native-progress react-native-svg @react-native-community/art react-native-progress-timer

Usage

import Timer from 'react-native-progress-timer';
<Timer
    remainingTime={10}
    size={350}
    showsText={true}
    animated={true}
    direction={'counter-clockwise'}
    borderColor={'#d9dcdd'}
    borderWidth={3}
    thickness={5}
    color={'#faac02'}
    style={options.style}
    textStyle={options.textStyle}
    options={options}
></Timer>

Properties for Options

| Prop | Description | Default | | --------------- | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | view | Style for Container | {flexDirection: 'row', justifyContent: 'space-between', margin: 10} | | highlight | Style for Touchable Highlight component | {backgroundColor: '#ffffff'} | | play | Style for Play component | {underlayColor: '#ffffff',borderColor: '#d9dcdd',textStyle:{color: '#000000'},style: {backgroundColor: '#ffffff'}} | | cancel | Style for Cancel component | {underlayColor: '#ffffff',borderColor: '#d9dcdd',textStyle:{color: '#000000'},style: {backgroundColor: '#ffffff'}} |

Properties for Timer Component (for more information refer to react-native-progress)

| Prop | Description | Default | | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------- | | animated | Whether or not to animate changes to progress. | true | | indeterminate | If set to true, the indicator will spin and progress prop will be ignored. | false | | indeterminateAnimationDuration | Sets animation duration in milliseconds when indeterminate is set. | 1000 | | color | Fill color of the indicator. | rgba(0, 122, 255, 1) | | unfilledColor | Color of the remaining progress. | None | | borderWidth | Width of outer border, set to 0 to remove. | 1 | | borderColor | Color of outer border. | color | | size | Diameter of the circle. | 350 | | endAngle | Determines the endAngle of the circle. A number between 0 and 1. The final endAngle would be the number multiplied by 2π | 0.9 | | thickness | Thickness of the inner circle. | 3 | | showsText | Whether or not to show a text representation of current progress. | true | | textStyle | Styles for progress text, defaults to a same color as circle and fontSize proportional to size prop. | { color: '#000000'} | | allowFontScaling | Whether or not to respect device font scale setting. | true | | direction | Direction of the circle clockwise or counter-clockwise. | clockwise | | strokeCap | Stroke Cap style for the circle butt, square or round. | butt | | fill | Fill color of the inner circle. | None (transparent) | | remainingTime | Timer countdown - Mandatory | 0 | | hideCancelCircle | Hide cancel circle | false | | textCancelCircle | Cancel circle text | Cancel | | sizeCancelCircle | Cancel circle size | 100 | | underlayColorCancelCircle | Cancel circle underlay color Mandatory | #ffffff | | hideStartCircle | Hide start circle | false | | textStartCircle | Start circle text | Start | | sizeStartCircle | Start circle size | 100 | | underlayStartCancelCircle | Cancel circle underlay color | #ffffff |

Example

import React from 'react'
import { SafeAreaView, StyleSheet, View } from 'react-native'
import Timer from 'react-native-progress-timer'

const App: () => React$Node = () => {
    return (
        <>
            <SafeAreaView>
                <View style={styles.body}>
                    <Timer
                        remainingTime={10}
                        size={350}
                        showsText={true}
                        animated={true}
                        direction={'counter-clockwise'}
                        borderColor={'#d9dcdd'}
                        borderWidth={3}
                        thickness={5}
                        color={'#faac02'}
                        style={options.style}
                        textStyle={options.textStyle}
                    ></Timer>
                </View>
            </SafeAreaView>
        </>
    )
}

const options = {
    style: {
        margin: 'auto',
    },
    textStyle: {
        color: '#000000',
    },
    view: {
        flexDirection: 'row',
        justifyContent: 'space-between',
        margin: 10,
    },
    highlight: {
        backgroundColor: '#ffffff',
    },
    play: {
        underlayColor: '#ffffff',
        borderColor: '#d9dcdd',
        textStyle: {
            color: '#000000',
        },
        style: {
            backgroundColor: '#ffffff',
        },
    },
    cancel: {
        underlayColor: '#ffffff',
        borderColor: '#d9dcdd',
        textStyle: {
            color: '#000000',
        },
        style: {
            backgroundColor: '#ffffff',
        },
    },
}

const styles = StyleSheet.create({
    scrollView: {
        backgroundColor: Colors.lighter,
    },
    body: {
        backgroundColor: Colors.white,
        alignItems: 'center',
        alignContent: 'center',
    },
})