https://github.com/only-icesoul/react-native-gradient
Gradient android ios web
https://github.com/only-icesoul/react-native-gradient
android conic gradient ios linear radial react react-native sweep web
Last synced: 7 months ago
JSON representation
Gradient android ios web
- Host: GitHub
- URL: https://github.com/only-icesoul/react-native-gradient
- Owner: Only-IceSoul
- License: mit
- Created: 2021-07-03T19:55:07.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-28T15:07:14.000Z (almost 4 years ago)
- Last Synced: 2024-06-23T04:03:36.522Z (over 1 year ago)
- Topics: android, conic, gradient, ios, linear, radial, react, react-native, sweep, web
- Language: Java
- Homepage:
- Size: 133 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```javascript
import { LinearGradient, RadialGradient,ConicGradient ,Color } from 'react-native-gradientview';// TODO: What to do with the module?
```
## LinearGradient
| Name | type | default |
| --- | --- | --- |
| startPoint | Object x y | 0.5 - 0 |
| endPoint | Object x y | 0.5 - 1 |
| colors | Array [Color] | white,black |
| positions | Array [number] | undefined |
| tileMode | (android,web) String | 'clamp' |
## RadialGradient| Name | type | default |
| --- | --- | --- |
| colors | Array [Color] | white,black |
| positions | Array [number] | undefined |
| cx | number | 0.5 |
| cy | number | 0.5 |
| rx | number | 0.5 |
| rx | number | 0.5 |
| tileMode | (android,web) String | 'clamp' |## ConicGradient
| Name | type | OS | default |
| --- | --- | --- | --- |
| startPoint | Object | ios | 0.5 - 0 |
| endPoint | Object | ios | 0.5 - 1 |
| colors | Array [Color] | android,web,ios | white,black |
| positions | Array [number] | android,web,ios | undefined |
| centerX | number | android,web | 0.5 |
| centerY | number | android,web | 0.5 |
| conicRotation | number | android,web | 0 |