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-image-gradient

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-image-gradient

React native package for linear gradient component on image

2.2.5
latest
Source
npm
Version published
Weekly downloads
10
150%
Maintainers
1
Weekly downloads
 
Created
Source

Image gradient, react component

React native package to display a gradient filter over an image.

To install

  • Run npm install react-native-image-gradient -s.
  • Run react-native link (or follow instructions to add react-native-linear-gradient to your project here).

Usage

import ImageGradient from 'react-native-image-gradient';

...

render(){
    return (
        <ImageGradient 
            mainStyle={styles.YOURS}
            gradientStyle={styles.YOURS}
            localImage={true|false}
            imageUrl={localReference|webReference}
            startPosition ={{x:0,y:0}}
            rgbcsvStart={'255,255,255'}
            rgbcsvEnd={'0,0,0'}
            opacityStart={0.9}
            opacityEnd={0.0}
        >
            <...>

        </ImageGradient>
    )
}

Props

  • mainStyle - styling for the main view component.
  • gradientStyle - styling for the iner view containing gradient view.
  • imageUrl - local or web path to the image. (if using web path, please set the localImage prop to false).
  • localImage - flag to specify wether the path is local or not. Default: true.
  • startPosition - initial coordinates for the gradient effect.Range [0-1].
  • endPosition - final coordinates for the gradient effect.Range [0-1].

PS: X is from left to right and Y is from top to bottom. Check the image below.

  • rgbcsvStart - color (in csv format) for the beginning of the linear gradient. Default: black '255,255,255'.
  • rgbcsvEnd - color (in csv format) for the end of the linear gradient. Default: white '0,0,0'.
  • opacityStart - opacity for the primary color. Range [0-1].
  • opacityEnd - opacity for the secondary color. Range [0-1].

PS: All props are optional

image

Keywords

react

FAQs

Package last updated on 21 Nov 2017

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