You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-native-simple-gradient-progressbar-view

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-simple-gradient-progressbar-view

Simple gradient progressbar view for React Native

0.2.0
latest
Source
npmnpm
Version published
Weekly downloads
74
174.07%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-simple-gradient-progressbar-view

Simple gradient progressbar view for React Native

Installation

npm install react-native-simple-gradient-progressbar-view

Usage

import SimpleGradientProgressbarView from "react-native-simple-gradient-progressbar-view";

<View style={styles.container}>
      <SimpleGradientProgressbarView
        style={styles.box} 
        fromColor="#FF0000"
        toColor="#0000FF"
        progress={0.50}
        maskedCorners={[0, 0, 1, 1]}
        cornerRadius={7.0} 
      />
      <SimpleGradientProgressbarView
        style={styles.box} 
        fromColor="#FF0000"
        toColor="#0000FF"
        progress={0.75}
        maskedCorners={[1, 1, 1, 1]}
        cornerRadius={7.0} 
    />
    <SimpleGradientProgressbarView
        style={styles.box} 
        fromColor="#FF0000"
        toColor="#0000FF"
        progress={1.0}
    />
    </View>
  );

  const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
  box: {
    width: 300,
    height: 30,
    marginVertical: 20,
    borderColor: '#000000',
    borderWidth: 1,
    borderRadius: 7.0,
  },
});

Availabale properites

// Available properties
type SimpleGradientProgressbarViewProps = {
  style: ViewStyle;
  fromColor: string; // color 
  toColor: string; // color
  progress: number; // 0.0 - 1.0
  maskedCorners?: Array<number>; 
  cornerRadius?: number;
};

Masked Corners

Masked corners property will only affact iOS >= 11 and Android. By default masking of all corners is enabled. To disable corner radius masking on specific corner you need to use maskedCorners property. Each value in array is coresponding to one corner:

  • maskedCorners={[leftTop, rightTop, leftBottom, rightBottom]}, where 0 = maskedCorner disabled , 1 - maskedCorners enabled;

All 4 values are required, however the maskedCorners property is optional. Eg. to disable masking on leftTop and rightBottom corners you need to set: maskedCorners={[0, 1, 1, 0]}.

Screenshots

iPhone

Android

License

MIT

Keywords

react-native

FAQs

Package last updated on 19 May 2021

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