Socket
Socket
Sign inDemoInstall

react-native-image-gradient

Package Overview
Dependencies
1
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-image-gradient

React native package for linear gradient component on image


Version published
Weekly downloads
56
increased by51.35%
Maintainers
1
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 21 Nov 2017

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc