🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

react-native-lingradient

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-lingradient

React-Native Best Animated LinearGradient

latest
Source
npmnpm
Version
1.1.4
Version published
Weekly downloads
17
88.89%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

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

npm install react-native-lingradient

Usage

import Lingradient from 'react-native-lingradient'

export default class Index extends React.Component {
    constructor(p) {
        super(p)
        this.state = {
            title:'1단계',
            locations: [ 0, 0.33, 0.33, 1 ],
            colors: ['#FE608B','#DB9BE8','#F4F4F4','#F4F4F4'],
        }
    }
    componentDidMount(){
        setTimeout(()=>{
            this.setState({
            title:'2단계',
            locations: [ 0, 0.66, 0.66, 1 ],
            colors: ['rgb(254,185,143)','rgb(240,97,95)','#F4F4F4','#F4F4F4'],
            })
        },2000)
        setTimeout(()=>{
            this.setState({
            title:'3단계',
            locations: [ 0, 1, 1, 1 ],
            colors: ['rgb(109,96,210)','rgb(213,144,233)','#F4F4F4','#F4F4F4'],
            })
        },4000)
    }
    render() {
        return (<SafeAreaView style={{ flex: 1, justifyContent:'center', }}>
            <View style={{ alignItems:'center', }}>
                <Text>{this.state.title}</Text>
            </View>
            <View style={{ height: 10 }}>
                <Lingradient
                    colors={this.state.colors}
                    locations={this.state.locations}
                    style={{
                    flex: 1
                    }}
                    start={{x: 0.0, y: 0}}
                    end={{x: 1, y: 0}}
                    duration={300}
                />
            </View>
        </SafeAreaView>)
    }
}

Keywords

react-native

FAQs

Package last updated on 16 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts