Skip to content
A simple gradient library for React Native.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
index.js
package.json

README.md

React Native Gradients

React Native Gradients Demo 1 React Native Gradients Demo 2 React Native Gradients Demo 3

Installation

First of all, install React Native Gradients using following commands.

// via NPM
npm install --save react-native-gradients

// via Yarn
yarn add react-native-gradients

It uses React Native SVG library, and because of this, link this library before run application.

react-native link react-native-svg

Usage

Linear Gradient

const colorList = [
  {offset: '0%', color: '#231557', opacity: '1'},
  {offset: '29%', color: '#44107A', opacity: '1'},
  {offset: '67%', color: '#FF1361', opacity: '1'},
  {offset: '100%', color: '#FFF800', opacity: '1'}
]
<LinearGradient colorList={colorList} angle={90}/>

Radial Gradient

const colorList = [
  {offset: '0%', color: '#231557', opacity: '1'},
  {offset: '29%', color: '#44107A', opacity: '1'},
  {offset: '67%', color: '#FF1361', opacity: '1'},
  {offset: '100%', color: '#FFF800', opacity: '1'}
]
<RadialGradient x="50%" y="50%" rx="50%" ry="50%" colorList={colorList}/>

SonarCloud

You can’t perform that action at this time.