You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interface is similar to `Text` & [LinearGradient](https://github.com/react-native-community/react-native-linear-gradient)
58
60
59
61
#### colors
62
+
60
63
An array of at least two color values that represent gradient colors. Example: `['red', 'blue']` sets gradient from red to blue.
61
-
64
+
62
65
#### start
66
+
63
67
An optional object of the following type: `{ x: number, y: number }`. Coordinates declare the position that the gradient starts at, as a fraction of the overall size of the gradient, starting from the top left corner. Example: `{ x: 0.1, y: 0.1 }` means that the gradient will start 10% from the top and 10% from the left.
64
-
68
+
65
69
#### end
70
+
66
71
Same as start, but for the end of the gradient.
67
-
72
+
68
73
#### locations
74
+
69
75
An optional array of numbers defining the location of each gradient color stop, mapping to the color with the same index in `colors` prop. Example: `[0.1, 0.75, 1]` means that first color will take 0% - 10%, second color will take 10% - 75% and finally third color will occupy 75% - 100%.
70
76
71
77
#### useViewFrame
78
+
72
79
Optional. If true gradient will be calculated for text view background frame rather than text frame.
73
80
74
81
```javascript
@@ -77,7 +84,7 @@ Optional. If true gradient will be calculated for text view background frame rat
77
84
useViewFrame={true}
78
85
locations={[0.5, 0.95]}
79
86
// note colors like '#FF000000' are used for seamless transition to transparent
80
-
colors={['#FF0000', '#FF000000']}
87
+
colors={["#FF0000", "#FF000000"]}
81
88
start={{ x:0, y:0 }}
82
89
end={{ x:1, y:0 }}
83
90
>
@@ -87,27 +94,28 @@ Optional. If true gradient will be calculated for text view background frame rat
87
94
88
95
<imgsrc="img/useViewFrame.png"width="300">
89
96
90
-
91
97
## Usage with rn >= 0.56.0
92
98
93
99
Wait until https://github.com/facebook/react/pull/13211 will be merged or patch react-native to remove failing invariant checks
0 commit comments