JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4898
  • Score
    100M100P100Q126859F
  • License MIT

React Native gradient library.

Package Exports

  • react-native-gradients

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-gradients) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React Native Gradients

React Native Gradients Demo 1 React Native Gradients Demo 1

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

It supports only linear gradient for now and it takes two props.

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} degree={90}/>