Code Monkey home page Code Monkey logo

react-native-progress-circle's Introduction

license Version npm Twitter Follow

React Native Progress Circle

React Native Progress Circles

Features

  • Custom colors
  • Custom size and border radius
  • Light-weight: No other dependencies besides react-native

Installation

yarn add react-native-progress-circle

or

npm install --save react-native-progress-circle

Usage

import ProgressCircle from 'react-native-progress-circle'

render() {
    return (
        <ProgressCircle
            percent={30}
            radius={50}
            borderWidth={8}
            color="#3399FF"
            shadowColor="#999"
            bgColor="#fff"
        >
            <Text style={{ fontSize: 18 }}>{'30%'}</Text>
        </ProgressCircle>
    )
}

Props

Name Description Type Required Default Value
percent The percentage used for displaying the progress Number
radius The radius in px of the component (including border) Number
borderWidth The border width in px Number
color The border color String #f00 '#f00'
shadowColor The background color of the border String #999 '#999'
bgColor The inner background color of the component String #e9e9ef '#e9e9ef'
children The children to render inside this component Node null
containerStyle The custom styling which will be applied to the container of the children Style null
outerCircleStyle The custom styling which will be applied to the outer circle Style null

Author

Christoph Michel

Implementation Details

React Native Progress Circle

License

MIT

react-native-progress-circle's People

Contributors

darekg11 avatar dependabot[bot] avatar jobijoba avatar linkinmedo avatar mrtoph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-progress-circle's Issues

tip marker

Hi MrToph,

is it possible to make/have this little circular marker at the tip?

progress circle

thanks.

image for reference only.
like your library. very easy to use.

Transparent circle

Hello,

Any idea to add transparency inside the circle?

Thank you for your work!

Error Android Cannot scaleX

I obtain the next error when tried render in Android 10:

image

anything idea ?

"react-native": "0.60.5",
"react-native-progress-circle": "2.1.0",

Shadow not working

Cannot see shadow

`import React, {Component} from 'react';
import {StyleSheet, Text, View, TouchableWithoutFeedback} from 'react-native';
import ProgressCircle from 'react-native-progress-circle'

export class ProgressBarHeightToWaistRatio extends Component {

getColor(value) {
if (value < 42) {
return "#58defc"
} else if (value >= 42 && value < 49 ) {
return "#89dd78"
} else if(value >= 49 && value < 54){
return "#f7a743"
} else {
return "#f92e2a"
}
}
render() {
const radius = this.props.value < 100 ? 25 : 32
return (


{this.props.value}%


)
}
}

const styles = StyleSheet.create({
value: {
fontSize: 14,
fontFamily: 'Lato-Regular',
letterSpacing: 0.13,
lineHeight: 17,
padding: 10,
color: '#FFFFFF',
fontWeight: 'bold',
}
})
`

Everything under 50% cant draw perfect

I have this code snippet:

<View style={{ marginTop: 25 }}>
    <ProgressCircle
        percent={40}
        radius={85}
        borderWidth={10}
        color={Colors.ORANGE}
        shadowColor={Colors.ORANGE_40}
        bgColor={Colors.WHITE}
    >
        <Icon name="play" size={40} color={Colors.BLUE} />
    </ProgressCircle>
</View>

I don't know what i have do wrong but my progress circle draw like this:
snimek obrazovky 2018-12-11 v 11 11 08

Maybe I am doing something wrong. Can you please help me @MrToph? Or is this real issue?

how to set progress-circle style ?

Hi,
I am using this lib, but i can not set style to ProgressCircle, it is not working.

this is my code
<ImageBackground style={styles.backgroundImage} imageStyle={styles.imageStyle} source={require('../img/img2.png')} > {/* <Text style={{ fontSize:20 , color:0XFF0000FF,marginBottom:100}}>JECK</Text> */} <ProgressCircle style={{ marginBottom: 100 }} percent={30} radius={20} borderWidth={8} color="#3399FF" shadowColor="#999" bgColor="#fff"> </ProgressCircle> </ImageBackground>

Text component is work with marginbottom, but ProgressCircle is not. can you help me ? thanks

Size ProgressCircle

how do i increase the width and height size?

<View style={styles.progressChart}>
                        <ProgressCircle                            
                            percent={80}
                            radius={50}
                            borderWidth={10}
                            color="#1F78B4"
                            shadowColor="#999"
                            bgColor="#fff"
                        >
                            <Text style={{ fontSize: 18 }}>{'20'}</Text>
                        </ProgressCircle>

in right to left languages circles weird

when I use the package it works fine in phone language en-US when I change language to arabic or any right to left language the result very strange .. I need your help
untitled

Dynamic percentage?

Is there any way on how to make the percentage dynamic, let's say we are fetching data from the API and we are going to show this progress circle?

Weird shape

hello,

I have tried to use your library, however, for some reason, the outer circle is not round!
2017-07-31 17_55_02-genymotion for personal use - samsung galaxy s3 - 4 1 1 - api 16 - 720x1280 720

I have copied the example code from your readme, it is the only thing returned by the render function, so I don't think it is the result of interference from styles of other parts of the code.

react-native version: 0.44.0
android api: 16 (emulator with 720x1280 resolution)

what do you think can cause this behavior?

thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.