linear gradient react code example

Example 1: linear gradient css react js

background-image: linear-gradient(to right, red , yellow);

Example 2: linear gradient react js

<LinearGradient 
  colors={['#4c669f', '#3b5998', '#192f6a']} 
  style={styles.linearGradient}>
  <Text style={styles.buttonText}>
    Simple Linear Gradient Backgrount
  </Text>
</LinearGradient>

Example 3: react native linear gradient

yarn add react-native-linear-gradient

Example 4: linear gradient react native

import LinearGradient from 'react-native-linear-gradient'; // Within your render function<LinearGradient colors={['#4c669f', '#3b5998', '#192f6a']} style={styles.linearGradient}>  <Text style={styles.buttonText}>    Sign in with Facebook  </Text></LinearGradient> // Later on in your styles..var styles = StyleSheet.create({  linearGradient: {    flex: 1,    paddingLeft: 15,    paddingRight: 15,    borderRadius: 5  },  buttonText: {    fontSize: 18,    fontFamily: 'Gill Sans',    textAlign: 'center',    margin: 10,    color: '#ffffff',    backgroundColor: 'transparent',  },});

Example 5: react native linear gradient

npm install react-native-linear-gradient --save