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)
59
61
60
62
#### colors
63
+
61
64
An array of at least two color values that represent gradient colors. Example: `['red', 'blue']` sets gradient from red to blue.
62
-
65
+
63
66
#### start
67
+
64
68
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.
65
-
69
+
66
70
#### end
71
+
67
72
Same as start, but for the end of the gradient.
68
-
73
+
69
74
#### locations
75
+
70
76
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%.
71
77
72
78
#### useViewFrame
79
+
73
80
Optional. If true gradient will be calculated for text view background frame rather than text frame.
74
81
75
82
```javascript
@@ -78,7 +85,7 @@ Optional. If true gradient will be calculated for text view background frame rat
78
85
useViewFrame={true}
79
86
locations={[0.5, 0.95]}
80
87
// note colors like '#FF000000' are used for seamless transition to transparent
81
-
colors={['#FF0000', '#FF000000']}
88
+
colors={["#FF0000", "#FF000000"]}
82
89
start={{ x:0, y:0 }}
83
90
end={{ x:1, y:0 }}
84
91
>
@@ -88,27 +95,28 @@ Optional. If true gradient will be calculated for text view background frame rat
88
95
89
96
<imgsrc="img/useViewFrame.png"width="300">
90
97
91
-
92
98
## Usage with rn >= 0.56.0
93
99
94
100
Wait until https://github.com/facebook/react/pull/13211 will be merged or patch react-native to remove failing invariant checks
0 commit comments