1.0.8 • Published 2 years ago

react-native-gradientview v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Gradientview

android: api 21+
ios : 10.0+
web: svg

Getting started

$ npm install react-native-gradientview --save
$ react-native link react-native-gradientview

or

$ yarn add react-native-gradientview

IOS

Add Swift

(expo sdk >=42 you don't need to do this)

/ios/name_project

add a .swift file

Usage

import { LinearGradient, RadialGradient,ConicGradient ,Color } from 'react-native-gradientview';

// TODO: What to do with the module?
   <LinearGradient {...props}
     colors={[Color('red'),Color('#ccc'),...]}
    />

    <RadialGradient {...props} />
    <ConicGradient {...props} />

LinearGradient

Nametypedefault
startPointObject x y0.5 - 0
endPointObject x y0.5 - 1
colorsArray Colorwhite,black
positionsArray numberundefined
tileMode(android,web) String'clamp'

RadialGradient

Nametypedefault
colorsArray Colorwhite,black
positionsArray numberundefined
cxnumber0.5
cynumber0.5
rxnumber0.5
rxnumber0.5
tileMode(android,web) String'clamp'

ConicGradient

NametypeOSdefault
startPointObjectios0.5 - 0
endPointObjectios0.5 - 1
colorsArray Colorandroid,web,ioswhite,black
positionsArray numberandroid,web,iosundefined
centerXnumberandroid,web0.5
centerYnumberandroid,web0.5
conicRotationnumberandroid,web0