Skip to content

Commit 3b6a734

Browse files
authored
Update README.md
1 parent 5e0d02e commit 3b6a734

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,28 @@ React-Native text gradient component for iOS & Android.
2525
- Android - WIP, currently only basic 'wrapper'-like behavior without nesting is supported;
2626
- React-Native - supported version >0.50, except of 0.53.0.
2727

28+
29+
## Example
30+
31+
```javascript
32+
import { LinearTextGradient } from 'react-native-text-gradient';
33+
34+
<LinearTextGradient
35+
style={{ fontWeight: 'bold', fontSize: 72 }}
36+
locations={[0, 1]}
37+
colors={['red', 'blue']}
38+
start={{ x: 0, y: 0 }}
39+
end={{ x: 1, y: 0 }}
40+
>
41+
THIS IS TEXT GRADIENT
42+
</LinearTextGradient>
43+
```
44+
45+
iOS | Android
46+
:---------------------------------------------:|:---------------------------------------------:
47+
<img src="img/ios.png" align="left" height="275"> | <img src="img/android.jpg" align="right" height="275">
48+
49+
2850
## Usage
2951

3052
### LinearTextGradient
@@ -48,27 +70,6 @@ Optional. If true gradient will be calculated for text view background frame rat
4870
<img src="img/useViewFrame.png" width="300">
4971

5072

51-
## Example
52-
53-
```javascript
54-
import { LinearTextGradient } from 'react-native-text-gradient';
55-
56-
<LinearTextGradient
57-
style={{ fontWeight: 'bold', fontSize: 72 }}
58-
locations={[0, 1]}
59-
colors={['red', 'blue']}
60-
start={{ x: 0, y: 0 }}
61-
end={{ x: 1, y: 0 }}
62-
>
63-
THIS IS TEXT GRADIENT
64-
</LinearTextGradient>
65-
```
66-
67-
iOS | Android
68-
:---------------------------------------------:|:---------------------------------------------:
69-
<img src="img/ios.png" align="left" height="275"> | <img src="img/android.jpg" align="right" height="275">
70-
71-
7273
## Caveats
7374

7475
When mixing several text gradients and `Text`s top component always should be text gradient.

0 commit comments

Comments
 (0)